Skip to content

Commit

Permalink
fix(images): download tools with correct TARGETARCH for multi-platfor… (
Browse files Browse the repository at this point in the history
#6079)

fix(images): download tools with correct TARGETARCH for multi-platform images
  • Loading branch information
twelvemo authored May 27, 2024
1 parent 7a68373 commit 5a216f9
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 24 deletions.
26 changes: 18 additions & 8 deletions images/buildkit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
FROM moby/buildkit:v0.12.2@sha256:8ea9857f95c2a0402c245bb0e94f36e2b5b4a1cb05e7ed322c213ed50607ce62 as buildkit
FROM moby/buildkit:v0.13.2@sha256:9194b5ec1be368f41c516df7f93f7f540630ea06136056b2ffebb62226ed4ad6 as buildkit

RUN apk add --no-cache wget

ARG TARGETARCH
# ECR credential helper
RUN cd /usr/local/bin && \
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.6.0/linux-amd64/docker-credential-ecr-login && \
echo "af805202cb5d627dde2e6d4be1f519b195fd5a3a35ddc88d5010b4a4e5a98dd8 docker-credential-ecr-login" | sha256sum -c && \
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.8.0/linux-$TARGETARCH/docker-credential-ecr-login && \
if [ "$TARGETARCH" = "amd64" ]; then \
echo "dcc7ae9915b5d8fa2d9e2b18fc30bab5bfbbce5b82401c7644e6ab97973ac35c docker-credential-ecr-login" | sha256sum -c; \
elif [ "$TARGETARCH" = "arm64" ]; then \
echo "d62badea3153688ec5c24f440df9fb84ff4b02c624dff9288967267e7445daa1 docker-credential-ecr-login" | sha256sum -c; \
fi && \
chmod +x docker-credential-ecr-login

ARG TARGETARCH
# GCR credential helper
RUN cd /usr/local/bin && \
wget "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.1.14/docker-credential-gcr_linux_amd64-2.1.14.tar.gz" && \
echo "81f2d215466ab5bf6a350aadab42b42ad29590d16eab39f28014e4a6563c848a docker-credential-gcr_linux_amd64-2.1.14.tar.gz" | sha256sum -c && \
tar xzf docker-credential-gcr_linux_amd64-2.1.14.tar.gz && \
rm docker-credential-gcr_linux_amd64-2.1.14.tar.gz && \
wget https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.1.22/docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz && \
if [ "$TARGETARCH" = "amd64" ]; then \
echo "443e897dc383d69e55e6dbcb13802f4ec88444848612e83f0381df2ddd721694 docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz" | sha256sum -c; \
elif [ "$TARGETARCH" = "arm64" ]; then \
echo "b607dfb7516dc1ca6a2a05322d938cea58cc5975e2063efc3695ee6ddb2dccc7 docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz" | sha256sum -c; \
fi && \
tar xzf docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz && \
rm docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz && \
chmod +x docker-credential-gcr

FROM moby/buildkit:v0.12.2-rootless@sha256:0919807170af622451887366c17408dc9a946d04c6fe4fcca3071f9637f8598f as buildkit-rootless
FROM moby/buildkit:v0.13.2-rootless@sha256:1fa728c7d7e97630ee551a69c7f8672ebdfc859922822ee249cf80ab3ee2ee4c as buildkit-rootless

COPY --from=buildkit /usr/local/bin/docker-credential-ecr-login /usr/local/bin/docker-credential-ecr-login
COPY --from=buildkit /usr/local/bin/docker-credential-gcr /usr/local/bin/docker-credential-gcr
2 changes: 1 addition & 1 deletion images/k8s-reverse-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM linuxserver/openssh-server:amd64-8.8_p1-r1-ls93@sha256:dfd841269e871df5a973da7871af9ecc2dde15e671236525c78db1f75de71021
FROM linuxserver/openssh-server:version-9.6_p1-r0@sha256:813375fb9b6d247c4ee355d94ac2feda372d0f5553f01f2a12e44b258972fee2

WORKDIR /app

Expand Down
9 changes: 7 additions & 2 deletions images/k8s-sync/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ FROM alpine:3.19.1@sha256:6457d53fb065d6f250e1504b9bc42d5b6c65941d57532c072d929d

RUN apk add --no-cache wget

ARG TARGETARCH
# Get mutagen agent
RUN MUTAGEN_VERSION="0.17.5" && \
mutagen_distr_name="mutagen_linux_amd64_v${MUTAGEN_VERSION}.tar.gz" && \
mutagen_distr_name="mutagen_linux_${TARGETARCH}_v${MUTAGEN_VERSION}.tar.gz" && \
wget "https://github.com/mutagen-io/mutagen/releases/download/v${MUTAGEN_VERSION}/${mutagen_distr_name}" && \
echo "cabee0af590faf822cb5542437e254406b0f037df43781c02bf6eeac267911f6 ${mutagen_distr_name}" | sha256sum -c && \
if [ "$TARGETARCH" = "amd64" ]; then \
echo "cabee0af590faf822cb5542437e254406b0f037df43781c02bf6eeac267911f6 ${mutagen_distr_name}" | sha256sum -c; \
elif [ "$TARGETARCH" = "arm64" ]; then \
echo "bbe92496c2bad6424a879490ca5b49da36c80e28e7b866201fcaf7a959037237 ${mutagen_distr_name}" | sha256sum -c; \
fi && \
tar xzf ${mutagen_distr_name} --to-stdout mutagen-agents.tar.gz \
| tar xz --to-stdout linux_amd64 > /usr/local/bin/mutagen-agent && \
rm ${mutagen_distr_name} && \
Expand Down
25 changes: 18 additions & 7 deletions images/k8s-util/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

RUN apk add --no-cache wget rsync skopeo
ARG TARGETARCH
# ECR credential helper
RUN cd /usr/local/bin && \
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.6.0/linux-amd64/docker-credential-ecr-login && \
echo "af805202cb5d627dde2e6d4be1f519b195fd5a3a35ddc88d5010b4a4e5a98dd8 docker-credential-ecr-login" | sha256sum -c && \
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.8.0/linux-$TARGETARCH/docker-credential-ecr-login && \
if [ "$TARGETARCH" = "amd64" ]; then \
echo "dcc7ae9915b5d8fa2d9e2b18fc30bab5bfbbce5b82401c7644e6ab97973ac35c docker-credential-ecr-login" | sha256sum -c; \
elif [ "$TARGETARCH" = "arm64" ]; then \
echo "d62badea3153688ec5c24f440df9fb84ff4b02c624dff9288967267e7445daa1 docker-credential-ecr-login" | sha256sum -c; \
fi && \
chmod +x docker-credential-ecr-login

ARG TARGETARCH
# GCR credential helper
RUN cd /usr/local/bin && \
wget "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.1.14/docker-credential-gcr_linux_amd64-2.1.14.tar.gz" && \
echo "81f2d215466ab5bf6a350aadab42b42ad29590d16eab39f28014e4a6563c848a docker-credential-gcr_linux_amd64-2.1.14.tar.gz" | sha256sum -c && \
tar xzf docker-credential-gcr_linux_amd64-2.1.14.tar.gz && \
rm docker-credential-gcr_linux_amd64-2.1.14.tar.gz && \
wget https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.1.22/docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz && \
if [ "$TARGETARCH" = "amd64" ]; then \
echo "443e897dc383d69e55e6dbcb13802f4ec88444848612e83f0381df2ddd721694 docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz" | sha256sum -c; \
elif [ "$TARGETARCH" = "arm64" ]; then \
echo "b607dfb7516dc1ca6a2a05322d938cea58cc5975e2063efc3695ee6ddb2dccc7 docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz" | sha256sum -c; \
fi && \
tar xzf docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz && \
rm docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz && \
chmod +x docker-credential-gcr

RUN adduser -g 1000 -D user && \
Expand Down
24 changes: 18 additions & 6 deletions images/skopeo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
FROM danifernandezs/skopeo:1.41.0-alpine3.10.3@sha256:3063f966f2752491ba2c3acb0e903a001c586e0fb5f404b8e8c3ac1f9e93c9f2

RUN apk add --no-cache wget
ARG TARGETARCH
# ECR credential helper
RUN cd /usr/local/bin && \
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.6.0/linux-amd64/docker-credential-ecr-login && \
echo "af805202cb5d627dde2e6d4be1f519b195fd5a3a35ddc88d5010b4a4e5a98dd8 docker-credential-ecr-login" | sha256sum -c && \
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.8.0/linux-$TARGETARCH/docker-credential-ecr-login && \
if [ "$TARGETARCH" = "amd64" ]; then \
echo "dcc7ae9915b5d8fa2d9e2b18fc30bab5bfbbce5b82401c7644e6ab97973ac35c docker-credential-ecr-login" | sha256sum -c; \
elif [ "$TARGETARCH" = "arm64" ]; then \
echo "d62badea3153688ec5c24f440df9fb84ff4b02c624dff9288967267e7445daa1 docker-credential-ecr-login" | sha256sum -c; \
fi && \
chmod +x docker-credential-ecr-login

ARG TARGETARCH
# GCR credential helper
RUN cd /usr/local/bin && \
wget "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.1.14/docker-credential-gcr_linux_amd64-2.1.14.tar.gz" && \
echo "81f2d215466ab5bf6a350aadab42b42ad29590d16eab39f28014e4a6563c848a docker-credential-gcr_linux_amd64-2.1.14.tar.gz" | sha256sum -c && \
tar xzf docker-credential-gcr_linux_amd64-2.1.14.tar.gz && \
rm docker-credential-gcr_linux_amd64-2.1.14.tar.gz && \
wget https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.1.22/docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz && \
if [ "$TARGETARCH" = "amd64" ]; then \
echo "443e897dc383d69e55e6dbcb13802f4ec88444848612e83f0381df2ddd721694 docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz" | sha256sum -c; \
elif [ "$TARGETARCH" = "arm64" ]; then \
echo "b607dfb7516dc1ca6a2a05322d938cea58cc5975e2063efc3695ee6ddb2dccc7 docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz" | sha256sum -c; \
fi && \
tar xzf docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz && \
rm docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz && \
chmod +x docker-credential-gcr

0 comments on commit 5a216f9

Please sign in to comment.