docker: use distroless base image to reduce size

distroless already includes ca-certificate, but none of the extras
included in debian, reducing image by 40% (163 MB versus 275 MB).
This commit is contained in:
Will Norris 2022-05-03 11:56:07 -07:00 committed by Brad Fitzpatrick
parent 5bf75895b8
commit ddbeb109b1
1 changed files with 2 additions and 6 deletions

View File

@ -24,12 +24,8 @@ RUN go run make.go -v
FROM debian:stretch
FROM gcr.io/distroless/base
RUN apt-get update && apt-get install -y --no-install-recommends \
libsqlite3-dev ca-certificates && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /home/keepy/bin
ENV HOME /home/keepy
ENV PATH /home/keepy/bin:$PATH
@ -39,4 +35,4 @@ COPY --from=pkbuild /go/bin/perkeepd /home/keepy/bin/
EXPOSE 80 443 3179 8080
WORKDIR /home/keepy
CMD /bin/bash
CMD ["perkeepd"]