From 876dbc5aa86bfd88d149c9490621a05034e9659f Mon Sep 17 00:00:00 2001 From: David Szeto <> Date: Wed, 27 Nov 2024 13:21:27 -0600 Subject: [PATCH] Pull arch-specific docker-compose in Ubuntu Dockerfiles --- images/ghes-demo.Dockerfile | 6 +++++- images/rootless-ubuntu-jammy.Dockerfile | 6 +++++- images/rootless-ubuntu-numbat.Dockerfile | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/images/ghes-demo.Dockerfile b/images/ghes-demo.Dockerfile index 0282ed0..19842d5 100644 --- a/images/ghes-demo.Dockerfile +++ b/images/ghes-demo.Dockerfile @@ -163,7 +163,11 @@ ENV HOME=/home/runner USER runner # Docker-compose installation -RUN curl --create-dirs -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-Linux-x86_64" -o /home/runner/bin/docker-compose ; \ +RUN ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ + && export ARCH \ + && if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \ + && if [ "$ARCH" = "amd64" ]; then export ARCH=x86_64 ; fi \ + && curl --create-dirs -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-Linux-${ARCH}" -o /home/runner/bin/docker-compose ; \ chmod +x /home/runner/bin/docker-compose ENTRYPOINT ["/usr/local/bin/dumb-init", "--"] diff --git a/images/rootless-ubuntu-jammy.Dockerfile b/images/rootless-ubuntu-jammy.Dockerfile index a0e49f6..58d2b5c 100644 --- a/images/rootless-ubuntu-jammy.Dockerfile +++ b/images/rootless-ubuntu-jammy.Dockerfile @@ -135,7 +135,11 @@ ENV ImageOS=ubuntu22 USER runner # Docker-compose installation -RUN curl --create-dirs -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-Linux-x86_64" -o /home/runner/bin/docker-compose ; \ +RUN ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ + && export ARCH \ + && if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \ + && if [ "$ARCH" = "amd64" ]; then export ARCH=x86_64 ; fi \ + && curl --create-dirs -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-Linux-${ARCH}" -o /home/runner/bin/docker-compose ; \ chmod +x /home/runner/bin/docker-compose ENTRYPOINT ["/usr/local/bin/dumb-init", "--"] diff --git a/images/rootless-ubuntu-numbat.Dockerfile b/images/rootless-ubuntu-numbat.Dockerfile index 473d040..03fc1ca 100644 --- a/images/rootless-ubuntu-numbat.Dockerfile +++ b/images/rootless-ubuntu-numbat.Dockerfile @@ -132,7 +132,11 @@ ENV ImageOS=ubuntu24 USER runner # Docker-compose installation -RUN curl --create-dirs -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-Linux-x86_64" -o /home/runner/bin/docker-compose ; \ +RUN ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ + && export ARCH \ + && if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \ + && if [ "$ARCH" = "amd64" ]; then export ARCH=x86_64 ; fi \ + && curl --create-dirs -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-Linux-${ARCH}" -o /home/runner/bin/docker-compose ; \ chmod +x /home/runner/bin/docker-compose ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]