Skip to content

Commit

Permalink
fix docker image build error
Browse files Browse the repository at this point in the history
Signed-off-by: xeptore <[email protected]>
  • Loading branch information
xeptore committed Mar 22, 2023
1 parent 5e6633a commit acd81a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
concurrency:
group: ${{ github.workflow }}
group: ${{ github.workflow }}-${{ github.ref_type }}
cancel-in-progress: true
jobs:
main:
Expand All @@ -27,6 +27,10 @@ jobs:
go-version-file: go.mod
cache: false
check-latest: true
- name: Set Go Environment Variables
run: |
echo "GOOS=$(go env GOOS)" >> $GITHUB_ENV
echo "GOARCH=$(go env GOARCH)" >> $GITHUB_ENV
- name: Tidy
run: make tidy
- name: Build
Expand Down Expand Up @@ -80,6 +84,9 @@ jobs:
context: .
file: Dockerfile
no-cache: true
build-args: |
GOOS: ${{ env.GOOS }}
GOARCH: ${{ env.GOARCH }}
tags: |
ghcr.io/${{ github.repository }}/ingest:latest
labels: ${{ steps.meta.outputs.labels }}
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ RUN go mod download -x

COPY --chown=nonroot:nonroot . .

ARG GOOS=linux

ARG GOARCH=amd64

RUN make build

RUN mv ./bin/ingest_${GOOS}_${GOARCH} ./bin/ingest

FROM gcr.io/distroless/base-debian11:nonroot

COPY --from=build --chown=nonroot:nonroot /home/nonroot/bin/ingest ingest
Expand Down

0 comments on commit acd81a2

Please sign in to comment.