mirror of https://github.com/docker/compose.git
Trim the dockerfile and re-use the virtualenv we already have.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
9978c3ea52
commit
8b29a50b52
27
Dockerfile
27
Dockerfile
|
@ -10,15 +10,16 @@ RUN set -ex; \
|
||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
git \
|
git \
|
||||||
apt-transport-https \
|
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
lxc \
|
|
||||||
iptables \
|
|
||||||
libsqlite3-dev \
|
libsqlite3-dev \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN curl https://get.docker.com/builds/Linux/x86_64/docker-latest \
|
||||||
|
-o /usr/local/bin/docker && \
|
||||||
|
chmod +x /usr/local/bin/docker
|
||||||
|
|
||||||
# Build Python 2.7.9 from source
|
# Build Python 2.7.9 from source
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
curl -LO https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz; \
|
curl -LO https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz; \
|
||||||
|
@ -69,19 +70,17 @@ ENV LANG en_US.UTF-8
|
||||||
RUN useradd -d /home/user -m -s /bin/bash user
|
RUN useradd -d /home/user -m -s /bin/bash user
|
||||||
WORKDIR /code/
|
WORKDIR /code/
|
||||||
|
|
||||||
RUN pip install tox
|
|
||||||
|
|
||||||
ADD requirements.txt /code/
|
|
||||||
RUN pip install -r requirements.txt
|
|
||||||
|
|
||||||
ADD requirements-dev.txt /code/
|
|
||||||
RUN pip install -r requirements-dev.txt
|
|
||||||
|
|
||||||
RUN pip install tox==2.1.1
|
RUN pip install tox==2.1.1
|
||||||
|
|
||||||
ADD . /code/
|
ADD requirements.txt /code/
|
||||||
RUN pip install --no-deps -e /code
|
ADD requirements-dev.txt /code/
|
||||||
|
ADD .pre-commit-config.yaml /code/
|
||||||
|
ADD setup.py /code/
|
||||||
|
ADD tox.ini /code/
|
||||||
|
ADD compose /code/compose/
|
||||||
|
RUN tox --notest
|
||||||
|
|
||||||
|
ADD . /code/
|
||||||
RUN chown -R user /code/
|
RUN chown -R user /code/
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-compose"]
|
ENTRYPOINT ["/code/.tox/py27/bin/docker-compose"]
|
||||||
|
|
|
@ -4,8 +4,4 @@ set -ex
|
||||||
|
|
||||||
TAG="docker-compose"
|
TAG="docker-compose"
|
||||||
docker build -t "$TAG" .
|
docker build -t "$TAG" .
|
||||||
docker run \
|
docker run --rm --entrypoint="script/build-linux-inner" "$TAG"
|
||||||
--rm \
|
|
||||||
--volume="$(pwd):/code" \
|
|
||||||
--entrypoint="script/build-linux-inner" \
|
|
||||||
"$TAG"
|
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
TARGET=dist/docker-compose-Linux-x86_64
|
TARGET=dist/docker-compose-Linux-x86_64
|
||||||
|
VENV=/code/.tox/py27
|
||||||
|
|
||||||
mkdir -p `pwd`/dist
|
mkdir -p `pwd`/dist
|
||||||
chmod 777 `pwd`/dist
|
chmod 777 `pwd`/dist
|
||||||
|
|
||||||
pip install -r requirements-build.txt
|
$VENV/bin/pip install -r requirements-build.txt
|
||||||
su -c "pyinstaller docker-compose.spec" user
|
su -c "$VENV/bin/pyinstaller docker-compose.spec" user
|
||||||
mv dist/docker-compose $TARGET
|
mv dist/docker-compose $TARGET
|
||||||
$TARGET version
|
$TARGET version
|
||||||
|
|
Loading…
Reference in New Issue