Skip to content

Commit

Permalink
build our docker images for multiple platforms (#1059)
Browse files Browse the repository at this point in the history
Following this documentation:
https://docs.docker.com/build/ci/github-actions/multi-platform/

This clears up a warning in our build, and makes it easier for folks on
arm64 (like us macOS people) to pull and use the images.

Along the way, I also fixed the warnings about using lowercase `as` when
we use uppercase commands in our Dockerfile.
  • Loading branch information
jmhodges authored Nov 7, 2024
1 parent 9558e87 commit 9329ceb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
- name: Clone repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down Expand Up @@ -73,6 +76,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
platforms: linux/amd64,linux/arm64

# copypasta from https://github.com/imjasonh/setup-crane/blob/main/action.yml
- name: Set up crane
Expand All @@ -92,7 +96,6 @@ jobs:
echo "${tmp}" >> $GITHUB_PATH
echo "${{ github.token }}" | crane auth login ghcr.io --username "dummy" --password-stdin
- name: Tag and push
# For releases, we specifically do _not_ want to rebuild, just tag the
# existing image and push. There's no officially maintained action for
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG LIBKMSP11_VERSION=1.6
#------------------------------------------------------------------------------
# Base Debian Image
#------------------------------------------------------------------------------
FROM --platform=linux/amd64 debian:bookworm as base
FROM debian:bookworm AS base
ARG GO_VERSION

ENV DEBIAN_FRONTEND='noninteractive' \
Expand Down Expand Up @@ -38,7 +38,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/*
#------------------------------------------------------------------------------
# Pre-build dependency caching
#------------------------------------------------------------------------------
FROM base as prebuild
FROM base AS prebuild
ARG LIBKMSP11_VERSION

COPY google-pkcs12-release-signing-key.pem /app/src/autograph/
Expand All @@ -56,7 +56,7 @@ RUN curl -o /usr/local/share/old-rds-ca-bundle.pem https://s3.amazonaws.com/rds-
#------------------------------------------------------------------------------
# Build Stage
#------------------------------------------------------------------------------
FROM prebuild as builder
FROM prebuild AS builder

ADD . /app/src/autograph
RUN cd /app/src/autograph && go install .
Expand Down

0 comments on commit 9329ceb

Please sign in to comment.