Skip to content

Commit 074d997

Browse files
authored
Update Dockerfile
Signed-off-by: Alex Ellis <[email protected]>
1 parent 474c94f commit 074d997

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Dockerfile

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.18-alpine as builder
1+
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine as builder
22

33
ARG TARGETPLATFORM
44
ARG BUILDPLATFORM
@@ -18,10 +18,8 @@ COPY go.mod .
1818

1919
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test -mod=vendor $(go list ./... | grep -v /vendor/) -cover
2020

21-
# add user in this stage because it cannot be done in next stage which is built from scratch
22-
# in next stage we'll copy user and group information from this stage
23-
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -mod=vendor -ldflags "-s -w -X main.GitCommit=${GitCommit} -X main.Version=${Version}" -a -installsuffix cgo -o /usr/bin/license-check \
24-
&& addgroup -S app \
21+
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -mod=vendor -ldflags "-s -w -X main.GitCommit=${GitCommit} -X main.Version=${Version}" -o /usr/bin/license-check
22+
RUN addgroup -S app \
2523
&& adduser -S -g app app
2624

2725
FROM scratch

0 commit comments

Comments
 (0)