Skip to content

Commit

Permalink
Pull arch-specific docker-compose in Ubuntu Dockerfiles (#282)
Browse files Browse the repository at this point in the history
Co-authored-by: David Szeto <>
Co-authored-by: Natalie Somersall <[email protected]>
  • Loading branch information
dszeto2 and some-natalie authored Dec 3, 2024
1 parent 3d839a4 commit 6e79660
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion images/ghes-demo.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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", "--"]
Expand Down
6 changes: 5 additions & 1 deletion images/rootless-ubuntu-jammy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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", "--"]
6 changes: 5 additions & 1 deletion images/rootless-ubuntu-numbat.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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", "--"]

0 comments on commit 6e79660

Please sign in to comment.