Reduce the docker image size further by basing on scratch instead of alpine

Unfortunately /etc/ssl/certs/ca-certificates.crt is still a dependency, but it's easy enough to just grab it from an Alpine image during build
This commit is contained in:
Jaryl Chng 2024-04-30 09:09:53 +08:00
parent 189b8895b0
commit 1ce8391c2b
No known key found for this signature in database
GPG key ID: 5E26D63172A9ACA4

View file

@ -1,8 +1,12 @@
FROM alpine:3.19
FROM alpine:3.19 as base
RUN apk --no-cache add ca-certificates
FROM scratch
ARG TARGETOS
ARG TARGETARCH
COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR /app
COPY build/glance-$TARGETOS-$TARGETARCH /app/glance