Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
COSI-29: Produce multi-architecture Docker images
Browse files Browse the repository at this point in the history
In the context of COSI driver, the driver should be usable on any OS
supported by Kubernetes. This will allow us to build arm64 images along
with already produced amd64 images
  • Loading branch information
anurag4DSB committed Oct 30, 2024
1 parent 91472db commit a096fbb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
packages: write
uses: scality/workflows/.github/workflows/docker-build.yaml@v2
with:
context: .
name: cosi
namespace: ${{ github.repository_owner }}
tag: ${{ github.sha }}
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
packages: write
uses: scality/workflows/.github/workflows/docker-build.yaml@v2
with:
context: .
name: cosi
namespace: ${{ github.repository_owner }}
tag: ${{ inputs.tag }}
platforms: linux/amd64,linux/arm64

create-github-release:
runs-on: ubuntu-latest
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
FROM golang:1.23.2 AS builder
ARG TARGETOS
ARG TARGETARCH

WORKDIR /app

ENV CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64

COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN go build -o scality-cosi-driver ./cmd/scality-cosi-driver
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -o scality-cosi-driver ./cmd/scality-cosi-driver

FROM gcr.io/distroless/static:latest
COPY --from=builder /app/scality-cosi-driver /scality-cosi-driver
Expand Down

0 comments on commit a096fbb

Please sign in to comment.