|
1 | 1 | # syntax = docker/dockerfile:1.3
|
2 |
| -ARG ALPINE_VERSION=3.17 |
| 2 | +ARG ALPINE_VERSION=3.19 |
3 | 3 | FROM alpine:${ALPINE_VERSION}
|
4 | 4 |
|
5 | 5 | RUN apk add --no-cache git python3 python3-dev py3-pip py3-setuptools build-base
|
6 | 6 |
|
7 |
| -# build wheels in first image |
| 7 | +# build wheels in a build stage |
| 8 | +ARG VIRTUAL_ENV=/opt/venv |
| 9 | +ENV PATH=${VIRTUAL_ENV}/bin:${PATH} |
| 10 | + |
| 11 | +RUN python3 -m venv ${VIRTUAL_ENV} |
| 12 | + |
8 | 13 | ADD . /tmp/src
|
9 | 14 | RUN cd /tmp/src && git clean -xfd && git status
|
10 | 15 | RUN mkdir /tmp/wheelhouse \
|
11 | 16 | && 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 \ |
14 | 19 | && ls -l /tmp/wheelhouse
|
15 | 20 |
|
16 | 21 | FROM alpine:${ALPINE_VERSION}
|
17 | 22 |
|
18 | 23 | # install python, git, bash, mercurial
|
19 | 24 | RUN apk add --no-cache git git-lfs python3 py3-pip py3-setuptools bash docker mercurial
|
20 | 25 |
|
| 26 | +ARG VIRTUAL_ENV=/opt/venv |
| 27 | +ENV PATH=${VIRTUAL_ENV}/bin:${PATH} |
| 28 | + |
| 29 | +RUN python3 -m venv ${VIRTUAL_ENV} |
| 30 | + |
21 | 31 | # install hg-evolve (Mercurial extensions)
|
22 |
| -RUN pip3 install hg-evolve --user --no-cache-dir |
| 32 | +RUN pip install hg-evolve --no-cache-dir |
23 | 33 |
|
24 | 34 | # install repo2docker
|
25 | 35 | 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 |
28 | 38 |
|
29 | 39 | # add git-credential helper
|
30 | 40 | COPY ./docker/git-credential-env /usr/local/bin/git-credential-env
|
|
0 commit comments