Skip to content

Commit

Permalink
[Docker image] Change base image to Google Container Tools 'distroless'
Browse files Browse the repository at this point in the history
  • Loading branch information
Icikowski committed Nov 16, 2021
1 parent d77e0d6 commit e8c2012
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions application/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"]

0 comments on commit e8c2012

Please sign in to comment.