Skip to content

Commit

Permalink
Change web base image from debian to scratch (#6006)
Browse files Browse the repository at this point in the history
It only required removing `RUN mkdir -p app` from the Dockerfile, which
is not really needed.

This diminishes the image size and avoids having frequent vulnerability
reports by image scanners in clusters appearing in debian. We were
upgrading the base image whenever we could, but it's an issue for older
releases.

Addresses comment in #5198
  • Loading branch information
alpeb authored Apr 9, 2021
1 parent 2278f04 commit d200e0b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -mod=readonly -o web/web -ldflags "-s -w" ./web

## package it all up
FROM debian:buster-20210208-slim
FROM scratch
WORKDIR /linkerd

COPY --from=await /tmp/linkerd-await .
COPY LICENSE .
COPY --from=golang /linkerd-build/web/web .
RUN mkdir -p app
COPY --from=webpack-bundle /linkerd-build/web/app/dist app/dist
COPY web/templates templates
COPY --from=golang /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
Expand Down

0 comments on commit d200e0b

Please sign in to comment.