Skip to content

Commit

Permalink
fix: Fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed Dec 7, 2023
1 parent eb8faa4 commit a75e348
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bundles
repos
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM golang:1.21 as builder

WORKDIR /workspace

COPY go.* .
RUN go mod download
RUN go mod download \
&& go mod verify

COPY pkg pkg
COPY cmd cmd
RUN go test ./... \
&& CGO_ENABLED=0 GOOS=linux go build -a -o /go-git-backup cmd/git-backup
RUN CGO_ENABLED=0 GOOS=linux go build -v -o /go-git-backup ./cmd/git-backup


# Use distroless as minimal base image to package the project
Expand All @@ -15,4 +17,4 @@ FROM gcr.io/distroless/static:nonroot

WORKDIR /
COPY --from=builder /go-git-backup .
ENTRYPOINT ["/go-git-backup"]
ENTRYPOINT ["/go-git-backup"]

0 comments on commit a75e348

Please sign in to comment.