Skip to content

Commit

Permalink
chore(docker): Change from alpine to distroless
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed May 22, 2024
1 parent 8c88265 commit cede593
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,7 @@ RUN <<EOT
go build -ldflags='-w -s' -trimpath -o print-xterm256
EOT


FROM alpine:3.19
FROM gcr.io/distroless/static:nonroot
WORKDIR /app

ARG USERNAME=print-xterm256
ARG UID=1000
ARG GID=$UID
RUN addgroup -g "$GID" "$USERNAME" \
&& adduser -S -u "$UID" -G "$USERNAME" "$USERNAME"

COPY --from=go-builder /app/print-xterm256 ./

USER $UID
CMD ["/app/print-xterm256"]
COPY --from=go-builder /app/print-xterm256 /
CMD ["/print-xterm256"]

0 comments on commit cede593

Please sign in to comment.