Skip to content

A single script that can install CA-certificates on multiple platforms

License

Notifications You must be signed in to change notification settings

bachorp/install-ca-certs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

A single script that can install CA-certificates on multiple platforms. Works with Alpine, Debian-like, and RHEL-like distributions.

Usage

sudo ./install.sh CA_CERTS_DIR

Add Certificates to a Docker Image

ARG BASE
FROM ${BASE}

USER root

RUN mkdir /tmp/install-ca-certs
# TODO: COPY or ADD certificates to /tmp/install-ca-certs/certs
# TODO: Pin install-ca-certs version
ADD --chmod=700 https://raw.githubusercontent.com/bachorp/install-ca-certs/main/install.sh /tmp/install-ca-certs/install.sh
RUN /tmp/install-ca-certs/install.sh /tmp/install-ca-certs/certs && rm -rf /tmp/install-ca-certs

ARG USER
# ok if empty string
USER ${USER}

You can use docker inspect --format-string '{{.Config.User}}' <BASE_IMAGE> to get the required argument USER.

Add Certificates to a Distroless (Debian-like) Docker Image

ARG BASE

FROM ${BASE} AS base
FROM debian AS build

COPY --from=base /etc/ssl/certs /etc/ssl/certs

RUN mkdir /tmp/install-ca-certs
# TODO: COPY or ADD certificates to /tmp/install-ca-certs/certs
# TODO: Pin install-ca-certs version
ADD --chmod=700 https://raw.githubusercontent.com/bachorp/install-ca-certs/main/install.sh /tmp/install-ca-certs/install.sh
RUN /tmp/install-ca-certs/install.sh /tmp/install-ca-certs/certs && rm -rf /tmp/install-ca-certs

FROM base
COPY --from=build /etc/ssl/certs /etc/ssl/certs

About

A single script that can install CA-certificates on multiple platforms

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages