@@ -21,9 +21,11 @@ FROM python:3.11-bullseye as build-stage
21
21
COPY requirements.txt requirements.txt
22
22
ARG PIP_CACHE_DIR=/tmp/pip-cache
23
23
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
24
- pip install build \
25
- && pip wheel \
24
+ pip wheel \
26
25
--wheel-dir=/tmp/wheels \
26
+ # pycurl 7.45.3 has wheels, but they aren't portable
27
+ # https://github.com/pycurl/pycurl/issues/834
28
+ --no-binary pycurl \
27
29
-r requirements.txt \
28
30
# Additional wheels for default-stage. Updates below should be repeated
29
31
# in default-stage.
@@ -63,11 +65,13 @@ RUN apt-get update \
63
65
&& rm -rf /var/lib/apt/lists/*
64
66
65
67
# install wheels built in the build stage
68
+ # --no-index ensures _only_ wheels from the build stage are installed
66
69
COPY requirements.txt /tmp/requirements.txt
67
70
ARG PIP_CACHE_DIR=/tmp/pip-cache
68
71
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
69
72
--mount=type=cache,from=build-stage,source=/tmp/wheels,target=/tmp/wheels \
70
73
pip install \
74
+ --no-index \
71
75
--find-links=/tmp/wheels/ \
72
76
-r /tmp/requirements.txt
73
77
@@ -93,6 +97,7 @@ ARG PIP_CACHE_DIR=/tmp/pip-cache
93
97
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
94
98
--mount=type=cache,from=build-stage,source=/tmp/wheels,target=/tmp/wheels \
95
99
pip install \
100
+ --no-index \
96
101
--find-links=/tmp/wheels/ \
97
102
# Updates below should be repeated in build-stage.
98
103
#
0 commit comments