Custom base image with tooling to support derivations.
3.3K
This docker image is a custom base image.
It is intended to be as minimalistic as possible, while still:
Two instructions control what process is spawned when a docker container is created: ENTRYPOINT and CMD. The full documentation for these, and other instructions is available online, and it is strongly recommended that it is reviewed prior to creating Dockerfiles.
In brief, the ENTRYPOINT instruction specifies what process will be spawned. If it is defined in exec form the executable is launched directly; otherwise, it is provided as an argument to /bin/sh -c. The CMD instruction specifies how the process will be spawned. If it is defined in exec form it is appended directly to the ENTRYPOINT arguments; otherwise, it processed by a command shell before the resultant is appended.
By defining both instructions in the base image, and by embedding a shell script, the following is accomplished:
NOTE: Although launching multiple processes using the entrypoint is possible, it is recommended that a process control system be used instead; such as supervisord.
The emedded entrypoint script is located at /sbin/entrypoint and performs the following actions:
/etc/entrypoint.d/ are executed.$EP_RUN is created.CMD are executed.64).8192)./var/local/container_initialized./run/secrets).EP_RSA_KEY_SIZE).rsa).CMD.30).#!/bin/bash
# /etc/entrypoint.d/foo
set -e -o pipefail
# Configure: foo
if [[ ! -e "${EP_RUN}" ]] ; then
log "Configuring $(basename "${0}") for first run ..."
export VAR1="${VAR1:=VAL1}"
# Interpolate all variables
VAR2=VAL2 render_template /usr/local/share/foo.conf /etc/foo/foo.conf
# Interpolate select variables
render_template /usr/local/share/bar.conf /etc/bar/bar.conf "\$ONLY \$THESE \$VARS"
fi
The embedded entrypoint script is located at /etc/entrypoint.d/ca-certificates and performs the following actions:
/usr/share/ca-certificates/docker/ are deployted into the containers trust store.The emedded healthcheck script is located at /sbin/healthcheck and performs the following actions:
/etc/healthcheck.d/ are executed, aborting after the first failure.#!/bin/bash
# /etc/healthcheck.d/foo
set -e -o pipefail
log "Checking if $(basename "${0}") is healthy ..."
ps --pid=1
A typical Dockerfile will install packages similar to the following:
RUN apt-get update && \
apt-get install --no-install-recommends --yes long list of packages && \
apt-get clean && \
apt-get autoremove && \
rm --force --recursive /tmp/* /var/lib/apt/lists/* /var/tmp/*
While effective, this boilerplate code is on the edge of readability, and can be expressed more simply as RUN docker-apt <long list of packages>.
For that purpose, three scripts have been embedded in the base image:
As of yet, this images does not contain any customizations; however, in the future it could contain common packages or initialization scripts. Typical uses could include:
/
├─ etc/
│ ├─ entrypoint.d/
│ └─ healthcheck.d/
├─ sbin/
│ ├─ apt-add-repo
│ ├─ docker-apt
│ ├─ docker-apt-clean
│ ├─ docker-apt-install
│ ├─ entrypoint
│ ├─ entrypoint.ca-certificates
│ └─ healthcheck
├─ usr/
│ └─ share/
│ └─ ca-certificates/
│ └─ docker/
└─ var/
└─ local/
└─ container_initialized
None.
None.
Content type
Image
Digest
sha256:dfc9cac18…
Size
69.3 MB
Last updated
1 day ago
docker pull crashvb/base:26.04