Fixes for Versioneer in the image

Versioneer wants git cli installed so it can ask about git revision
info.  So, install it.

Versioneer also cares about the name of the source directory.  So,
change it.

This gets us a version number like "0.9.2+257.g48b1f02" which is at
least better than "0+unknown".
This commit is contained in:
Jean-Paul Calderone 2017-05-31 11:04:33 -04:00
parent 48b1f0257b
commit d1aacc11af
2 changed files with 12 additions and 10 deletions

View File

@ -1,7 +1,6 @@
.appveyor.yml
.coveragerc
docs
.git
.gitattributes
.gitignore
misc

View File

@ -29,10 +29,12 @@ RUN apt-get --quiet update && \
rm -rf /var/lib/apt/lists/*
# libffi-dev should probably be a build-dep for python-nacl and python-openssl
# but isn't for some reason.
# but isn't for some reason. Also, versioneer depends on the git cli to
# compute the source version.
RUN apt-get --quiet update && apt-get --quiet install -y \
libffi-dev \
python-virtualenv \
git \
&& rm -rf /var/lib/apt/lists/*
# Source repositories seem to be disabled on the Xenial image now. Enable
@ -59,22 +61,23 @@ ENV WORMHOLE_USER_NAME="wormhole"
# Force the allocated user to uid 1000 because we hard-code 1000 below.
RUN adduser --uid 1000 --disabled-password --gecos "" "${WORMHOLE_USER_NAME}"
# Run the application with this working directory.
WORKDIR /app/run
# And give it to the user the application will run as.
RUN chown ${WORMHOLE_USER_NAME} /app/run
# Facilitate network connections to the application. The rendezvous server
# listens on 4000 by default. The transit relay server on 4001.
EXPOSE 4000
EXPOSE 4001
# Put the source somewhere pip will be able to see it.
ADD . /src
ADD . /magic-wormhole
# Get the app we want to run!
RUN /app/env/bin/pip install /src
WORKDIR /magic-wormhole
RUN /app/env/bin/pip install .
# Run the application with this working directory.
WORKDIR /app/run
# And give it to the user the application will run as.
RUN chown ${WORMHOLE_USER_NAME} /app/run
# Switch to a non-root user.
USER 1000