Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker distroless image how to add customize certificate to trust store?

gcr.io/distroless/java

How to add custom pki certificate?

like image 341
ethan Avatar asked Oct 03 '18 21:10

ethan


1 Answers

The distroless images are based on Debian 9, so you can do a multi-stage build and do something like the following:

FROM debian AS build-env

# Add CA files
ADD my-ca-file.crt /usr/local/share/ca-certificates/my-ca-file.crt
RUN update-ca-certificates

FROM gcr.io/distroless/base
COPY --from=build-env /etc/ssl/certs /etc/ssl/certs
like image 188
ghaering Avatar answered Sep 30 '22 09:09

ghaering