Skip to content

Commit

Permalink
feat(template): pin docker images (#107)
Browse files Browse the repository at this point in the history
Signed-off-by: Steffen Exler <[email protected]>
  • Loading branch information
linuxluigi authored Apr 30, 2022
1 parent dcc2437 commit 94d2c5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _template/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax = docker/dockerfile:1.2

# get modules, if they don't change the cache can be used for faster builds
FROM golang AS base
FROM golang:1.18@sha256:12d3995156cb0dcdbb9d3edb5827e4e8e1bf5bf92436bfd12d696ec997001a9a AS base
ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOOS=linux
Expand All @@ -22,7 +22,7 @@ RUN --mount=target=. \
go build -ldflags="-w -s" -o /app/main ./cmd/{{.Base.appName}}/*.go

# Import the binary from build stage
FROM gcr.io/distroless/static:nonroot as prd
FROM gcr.io/distroless/static:nonroot@sha256:2556293984c5738fc75208cce52cf0a4762c709cf38e4bf8def65a61992da0ad as prd
COPY --from=build /app/main /
# this is the numeric version of user nonroot:nonroot to check runAsNonRoot in kubernetes
USER 65532:65532
Expand Down

0 comments on commit 94d2c5b

Please sign in to comment.