-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jasmin Gacic <jasmin.gacic@gmail.com>
- Loading branch information
1 parent
5946f13
commit d77d3e3
Showing
2 changed files
with
15 additions
and
10 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,14 +1,18 @@ | ||
FROM golang:1.10 AS build | ||
FROM golang:1.17 AS build | ||
WORKDIR /go/src | ||
COPY go ./go | ||
COPY main.go . | ||
# Copy `go.mod` for definitions and `go.sum` to invalidate the next layer | ||
# in case of a change in the dependencies | ||
COPY go.mod go.sum ./ | ||
# Download dependencies | ||
RUN go mod download | ||
|
||
ENV CGO_ENABLED=0 | ||
RUN go get -d -v ./... | ||
|
||
RUN go build -a -installsuffix cgo -o openapi . | ||
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=linux go build -v -o kusk-gateway-api | ||
|
||
FROM scratch AS runtime | ||
COPY --from=build /go/src/openapi ./ | ||
COPY --from=build --chown=65532:65532 /go/src/kusk-gateway-api ./ | ||
EXPOSE 8080/tcp | ||
ENTRYPOINT ["./openapi"] | ||
|
||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["./kusk-gateway-api"] |