Skip to content

Commit 0fffbf8

Browse files
committed
Revert "mount wheels from build stage instead of copying them"
This reverts commit ed82b83.
1 parent fabf178 commit 0fffbf8

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

Dockerfile

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,29 @@
11
# syntax = docker/dockerfile:1.3
22
ARG ALPINE_VERSION=3.16
3-
FROM alpine:${ALPINE_VERSION} AS builder
3+
FROM alpine:${ALPINE_VERSION}
44

55
RUN apk add --no-cache git python3 python3-dev py-pip build-base
66

7-
# set pip's cache directory using this environment variable, and use
8-
# ARG instead of ENV to ensure its only set when the image is built
9-
ARG PIP_CACHE_DIR=/tmp/pip-cache
10-
117
# build wheels in first image
128
ADD . /tmp/src
139
RUN cd /tmp/src && git clean -xfd && git status
14-
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
15-
mkdir /tmp/wheelhouse \
10+
RUN mkdir /tmp/wheelhouse \
1611
&& cd /tmp/wheelhouse \
1712
&& pip3 install wheel \
18-
&& pip3 wheel /tmp/src \
13+
&& pip3 wheel --no-cache-dir /tmp/src \
1914
&& ls -l /tmp/wheelhouse
2015

2116
FROM alpine:${ALPINE_VERSION}
2217

2318
# install python, git, bash, mercurial
2419
RUN apk add --no-cache git git-lfs python3 py-pip bash docker mercurial
2520

26-
# repeat ARG from above
27-
ARG PIP_CACHE_DIR=/tmp/pip-cache
21+
# install hg-evolve (Mercurial extensions)
22+
RUN pip3 install hg-evolve --user --no-cache-dir
2823

2924
# install repo2docker
30-
# and hg-evolve (Mercurial extensions)
31-
# mount /tmp/wheelhouse from build stage
32-
# avoids extra layer when using COPY --from
33-
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
34-
--mount=type=cache,from=builder,source=/tmp/wheelhouse,target=/tmp/wheelhouse \
35-
pip3 install --ignore-installed --no-deps /tmp/wheelhouse/*.whl \
36-
&& pip3 install hg-evolve \
25+
COPY --from=0 /tmp/wheelhouse /tmp/wheelhouse
26+
RUN pip3 install --no-cache-dir --ignore-installed --no-deps /tmp/wheelhouse/*.whl \
3727
&& pip3 list
3828

3929
# add git-credential helper

0 commit comments

Comments
 (0)