Skip to content

Commit

Permalink
build: Add docker multi-platform configs (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsetiawan authored May 15, 2024
1 parent c46c62a commit 7ccd97b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
DOCKER_ORG: ${{ github.repository_owner }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
IMAGE_PLATFORMS: linux/amd64,linux/arm64

jobs:
build-base:
Expand Down Expand Up @@ -71,6 +72,7 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
platforms: ${{ env.IMAGE_PLATFORMS }}
context: ${{ env.IMAGE }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down Expand Up @@ -133,6 +135,7 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
platforms: ${{ env.IMAGE_PLATFORMS }}
context: ${{ matrix.IMAGE }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
5 changes: 5 additions & 0 deletions base-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
ARG BASE_IMAGE=mambaorg/micromamba:1.5.8-noble
FROM --platform=$BUILDPLATFORM $BASE_IMAGE

# Echo some info about platforms
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Set image metadata labels
LABEL org.opencontainers.image.title="SSEC Base Image"
LABEL org.opencontainers.image.version="0.1"
Expand Down

0 comments on commit 7ccd97b

Please sign in to comment.