Skip to content

Commit 756e7d1

Browse files
committed
Put everything inside a venv
1 parent dd9f6ad commit 756e7d1

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

Dockerfile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,36 @@ FROM alpine:${ALPINE_VERSION}
55
RUN apk add --no-cache git python3 python3-dev py3-pip py3-setuptools build-base
66

77
# build wheels in first image
8+
ENV VIRTUAL_ENV /opt/venv
9+
ENV PATH ${VIRTUAL_ENV}/bin:${PATH}
10+
11+
RUN python3 -m venv ${VIRTUAL_ENV}
12+
813
ADD . /tmp/src
914
RUN cd /tmp/src && git clean -xfd && git status
1015
RUN mkdir /tmp/wheelhouse \
1116
&& cd /tmp/wheelhouse \
12-
&& pip3 install wheel \
13-
&& pip3 wheel --no-cache-dir /tmp/src \
17+
&& pip install wheel \
18+
&& pip wheel --no-cache-dir /tmp/src \
1419
&& ls -l /tmp/wheelhouse
1520

1621
FROM alpine:${ALPINE_VERSION}
1722

1823
# install python, git, bash, mercurial
1924
RUN apk add --no-cache git git-lfs python3 py3-pip py3-setuptools bash docker mercurial
2025

26+
ENV VIRTUAL_ENV /opt/venv
27+
ENV PATH ${VIRTUAL_ENV}/bin:${PATH}
28+
29+
RUN python3 -m venv ${VIRTUAL_ENV}
30+
2131
# install hg-evolve (Mercurial extensions)
22-
RUN pip3 install hg-evolve --user --no-cache-dir
32+
RUN pip install hg-evolve --user --no-cache-dir
2333

2434
# install repo2docker
2535
COPY --from=0 /tmp/wheelhouse /tmp/wheelhouse
26-
RUN pip3 install --no-cache-dir --ignore-installed --no-deps /tmp/wheelhouse/*.whl \
27-
&& pip3 list
36+
RUN pip install --no-cache-dir --ignore-installed --no-deps /tmp/wheelhouse/*.whl \
37+
&& pip list
2838

2939
# add git-credential helper
3040
COPY ./docker/git-credential-env /usr/local/bin/git-credential-env

0 commit comments

Comments
 (0)