diff --git a/.github/workflows/docker-back.yaml b/.github/workflows/docker-back.yaml index 687e390..895f62c 100644 --- a/.github/workflows/docker-back.yaml +++ b/.github/workflows/docker-back.yaml @@ -33,9 +33,11 @@ jobs: - arch: "amd64" runs-on: ubuntu-latest platform: linux/amd64 + build-arg: "arch=amd64" - arch: "arm64" runs-on: ubuntu-latest - platform: linux/arm64 + platform: linux/amd64 + build-arg: "arch=arm64" runs-on: ${{ matrix.runs-on }} outputs: imageTag: ${{ env.ImageTag }} @@ -64,6 +66,7 @@ jobs: context: . file: ./back-prod.Dockerfile platforms: ${{ matrix.platform }} + build-args: ${{ matrix.build-arg }} cache-from: type=gha cache-to: type=gha,mode=max tags: | diff --git a/back-prod.Dockerfile b/back-prod.Dockerfile index 61a9e2e..0e269f9 100644 --- a/back-prod.Dockerfile +++ b/back-prod.Dockerfile @@ -6,7 +6,9 @@ WORKDIR ${ROOT} COPY ./back ./ RUN go get -RUN CGO_ENABLED=0 GOOS=linux go build -o server main.go && chmod +x ./server + +ARG arch=amd64 +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${arch} go build -o server main.go && chmod +x ./server FROM alpine:3 WORKDIR /app