Skip to content

Commit bf48ff0

Browse files
committed
Useu a different tag that includes the arm64 suffix (without the v8).
The missing `TARGETVARIANT` is not a bug. See docker/buildx#1652
1 parent 44a3a93 commit bf48ff0

File tree

1 file changed

+2
-44
lines changed

1 file changed

+2
-44
lines changed

Dockerfile

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,7 @@ ARG LIBMAXMINDDB_URL=https://github.com/maxmind/libmaxminddb/releases/download/$
2424
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
2525

2626
# Get Python cryptography wheel. It is needed for certbot.
27-
# NOTE: It seems to have a bug where `TARGETVARIANT` is not provided for
28-
# arm64/v8, thus we cannot directly use moonbuggy2000/python-musl-wheels. For
29-
# now, manually download the wheels.
30-
#FROM moonbuggy2000/python-musl-wheels:cryptography-openssl38.0.1-py3.10-${TARGETARCH}${TARGETVARIANT} AS mod_cryptography
31-
FROM alpine:3.16 as mod_cryptography
32-
ARG TARGETARCH
33-
ARG TARGETVARIANT
34-
ARG WHEELS_DIR=/wheels
35-
RUN \
36-
mkdir "$WHEELS_DIR" && cd "$WHEELS_DIR" && \
37-
case "$TARGETARCH" in \
38-
amd64) \
39-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/amd64/cffi-1.15.1-cp310-cp310-musllinux_1_1_x86_64.whl && \
40-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/amd64/cryptography-38.0.1-cp36-abi3-musllinux_1_1_x86_64.whl && \
41-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/amd64/pycparser-2.21-py2.py3-none-any.whl \
42-
;; \
43-
386) \
44-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/i386/cffi-1.15.1-cp310-cp310-musllinux_1_1_i686.whl && \
45-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/i386/cryptography-38.0.1-cp310-cp310-musllinux_1_2_i686.whl && \
46-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/i386/pycparser-2.21-py2.py3-none-any.whl \
47-
;; \
48-
arm) \
49-
case "$TARGETVARIANT" in \
50-
v6) \
51-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/armv6/cffi-1.15.1-cp310-cp310-musllinux_1_2_armv7l.whl && \
52-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/armv6/cryptography-38.0.1-cp310-cp310-musllinux_1_2_armv7l.whl && \
53-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/armv6/pycparser-2.21-py2.py3-none-any.whl \
54-
;; \
55-
v7) \
56-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/armv7/cffi-1.15.1-cp310-cp310-musllinux_1_2_armv7l.whl && \
57-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/armv7/cryptography-38.0.1-cp310-cp310-musllinux_1_2_armv7l.whl && \
58-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/armv7/pycparser-2.21-py2.py3-none-any.whl \
59-
;; \
60-
*) echo "ERROR: Unknown variant: $TARGETVARIANT" && exit 1 ;; \
61-
esac \
62-
;; \
63-
arm64) \
64-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/arm64v8/cffi-1.15.1-cp310-cp310-musllinux_1_2_aarch64.whl && \
65-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/arm64v8/cryptography-38.0.1-cp36-abi3-musllinux_1_1_aarch64.whl && \
66-
wget https://github.com/moonbuggy/docker-python-musl-wheels/raw/main/wheels/arm64v8/pycparser-2.21-py2.py3-none-any.whl \
67-
;; \
68-
*) echo "ERROR: Unknown arch: $TARGETARCH" && exit 1 ;; \
69-
esac
27+
FROM moonbuggy2000/python-musl-wheels:cryptography38.0.1-py3.10-${TARGETARCH}${TARGETVARIANT} AS mod_cryptography
7028

7129
# Build UPX.
7230
FROM --platform=$BUILDPLATFORM alpine:3.16 AS upx
@@ -109,7 +67,7 @@ RUN upx /tmp/go/bin/bcrypt-tool
10967

11068
# Build certbot.
11169
FROM alpine:3.16 AS certbot
112-
COPY --from=mod_cryptography /wheels /wheels
70+
COPY --from=mod_cryptography / /wheels
11371
RUN \
11472
apk --no-cache add build-base curl python3 && \
11573
curl -# -L "https://bootstrap.pypa.io/get-pip.py" | python3 && \

0 commit comments

Comments
 (0)