Skip to content

Commit

Permalink
cert-tool: use scratch docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
jkralik committed Feb 28, 2023
1 parent 1a95386 commit 4206eeb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/cert-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ RUN go mod download
COPY . .
RUN ( cd /usr/local/go && patch -p1 < $GOPATH/src/github.com/plgd-dev/hub/tools/docker/patches/shrink_tls_conn.patch )
WORKDIR $GOPATH/src/github.com/plgd-dev/hub/tools/cert-tool
RUN go build -o /go/bin/cert-tool ./cmd
RUN CGO_ENABLED=0 go build -o /go/bin/cert-tool ./cmd

FROM alpine:3.17 AS service
FROM alpine:3.17 AS security-provider
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot

FROM scratch AS service
COPY --from=security-provider /etc/passwd /etc/passwd
COPY --from=build /go/bin/cert-tool /usr/local/bin/cert-tool
USER nonroot
ENTRYPOINT [ "/usr/local/bin/cert-tool" ]

0 comments on commit 4206eeb

Please sign in to comment.