-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1357 from tdakkota/ci/fix-docker-image
ci(Dockerfile): add Go SDK to resulting image
- Loading branch information
Showing
2 changed files
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
ARG GO_VERSION=latest | ||
|
||
FROM golang:$GO_VERSION as builder | ||
|
||
FROM golang:$GO_VERSION AS builder | ||
WORKDIR /go/src/app | ||
|
||
COPY . . | ||
|
||
RUN go mod download | ||
|
||
RUN CGO_ENABLED=0 go build -o /go/bin/ogen ./cmd/ogen/main.go | ||
|
||
FROM scratch | ||
|
||
# We need go in resulting image to run goimports. | ||
COPY --from=builder /usr/local/go/ /usr/local/go/ | ||
ENV PATH="/usr/local/go/bin:${PATH}" | ||
# Copy built binary. | ||
WORKDIR / | ||
|
||
COPY --from=builder /go/bin/ogen ./ogen | ||
|
||
ENTRYPOINT ["./ogen"] |