-
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.
[Docker image] Change base image to Google Container Tools 'distroless'
- Loading branch information
Showing
1 changed file
with
4 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ RUN go mod download -x | |
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gpts -ldflags "-X 'main.version=${BUILD_VERSION}' -X 'main.gitCommit=${BUILD_GIT_COMMIT}' -X 'main.binaryType=static' -w -extldflags '-static'" . | ||
|
||
FROM alpine:latest | ||
FROM gcr.io/distroless/static:latest | ||
LABEL maintainer "Piotr Icikowski <[email protected]>" | ||
LABEL org.opencontainers.image.title "GPTS - General Purpose Test Service" | ||
LABEL org.opencontainers.image.description "Simple & easy to configure test service for serving content through HTTP" | ||
|
@@ -18,10 +18,7 @@ LABEL org.opencontainers.image.vendor "Piotr Icikowski" | |
LABEL org.opencontainers.image.url "https://github.com/Icikowski/GPTS" | ||
LABEL org.opencontainers.image.source "https://github.com/Icikowski/GPTS" | ||
LABEL org.opencontainers.image.licenses "GPL-3.0-or-later" | ||
RUN apk --no-cache add ca-certificates | ||
RUN adduser app -u 1000 -h /app -S -D | ||
WORKDIR /app/ | ||
WORKDIR / | ||
COPY --from=builder /app/gpts . | ||
RUN chmod a+x gpts | ||
USER 1000 | ||
CMD ["./gpts"] | ||
USER 65532:65532 | ||
ENTRYPOINT ["/gpts"] |