docker: use distroless base image to reduce size

3 views
Skip to first unread message

nor...@perkeep.org

unread,
Jun 17, 2022, 10:37:25 AM6/17/22
to camlistor...@googlegroups.com


https://github.com/perkeep/perkeep/commit/ddbeb109b1ba9724dd5e7355b2955c4c0aa3af67

commit ddbeb109b1ba9724dd5e7355b2955c4c0aa3af67
Author: Will Norris <wi...@willnorris.com>
Date: Tue May 3 11:56:07 2022 -0700

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).

diff --git a/Dockerfile b/Dockerfile
index 295ddcf..e35b368 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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"]
Reply all
Reply to author
Forward
0 new messages