Skip to content

Commit

Permalink
fix multiplatform build
Browse files Browse the repository at this point in the history
Signed-off-by: galal-hussein <[email protected]>
  • Loading branch information
galal-hussein committed Jun 5, 2024
1 parent db2d23f commit a751526
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/image-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,16 @@ jobs:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}

- name: Build container image for amd64
- name: Build container image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: rancher/hardened-containerd:${{ github.event.release.tag_name }}
file: Dockerfile
platforms: linux/amd64
build-args: |
TAG=${{ env.TAG }}
ARCH=amd64
- name: Build container image for arm64
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: rancher/hardened-containerd:${{ github.event.release.tag_name }}
file: Dockerfile
platforms: linux/arm64
platforms: linux/amd64, linux/arm64
build-args: |
TAG=${{ env.TAG }}
ARCH=arm64
- name: Build container image for Windows
uses: docker/build-push-action@v5
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ ARG BCI_IMAGE=registry.suse.com/bci/bci-base
ARG GO_IMAGE=rancher/hardened-build-base:v1.22.3b1
FROM ${BCI_IMAGE} as bci
FROM ${GO_IMAGE} as builder
ARG ARCH="amd64"
ARG GOOS="linux"
# setup required packages
RUN set -x && \
Expand All @@ -19,7 +18,7 @@ RUN set -x && \
mercurial \
subversion \
unzip
RUN if [ "${ARCH}" == "arm64" ]; then \
RUN if [ "${TARGETARCH}" == "arm64" ]; then \
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protoc-3.17.3-linux-aarch_64.zip; \
unzip protoc-3.17.3-linux-aarch_64.zip -d /usr; \
else \
Expand Down Expand Up @@ -48,7 +47,7 @@ RUN export GO_LDFLAGS="-linkmode=external \
go-build-static.sh ${GO_BUILDFLAGS} -o bin/containerd-shim-runc-v1 ./cmd/containerd-shim-runc-v1 && \
go-build-static.sh ${GO_BUILDFLAGS} -o bin/containerd-shim-runc-v2 ./cmd/containerd-shim-runc-v2
RUN go-assert-static.sh bin/*
RUN if [ "${ARCH}" = "amd64" ]; then \
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
go-assert-boring.sh \
bin/ctr \
bin/containerd; \
Expand Down

0 comments on commit a751526

Please sign in to comment.