added ENTRYPOINT_EXEC

This commit is contained in:
2026-05-21 20:14:21 -04:00
parent 31f0a2da6c
commit d863f85304
3 changed files with 11 additions and 2 deletions
+1
View File
@@ -3,6 +3,7 @@ FROM ${os.image.prefix}${os.image.name}:${os.image.version}${os.image.suffix}
ENV SKIP_ENTRYPOINT_SCRIPTS=false
ENV VERBOSE=true
ENV ENTRYPOINT_EXEC=
# these are effectively immutable; provided to be used by extending images
# the entrypoint will re-set these in case they are changed
+3
View File
@@ -15,6 +15,8 @@ The following tools are available.
This image provides an entrypoint script that executes other entrypoint scripts, before executing the `CMD` (if provided). It will execute any executable `.sh` scripts added to the path described by the `CONTAINERD_ENTRYPOINT_PATH` environment variable. It will execute them in default sort order, so the use of numerical prefixes (`00_first.sh` or `99_last.sh`) may be wise.
You may also provide an `ENTRYPOINT_EXEC` to prefix all `CMD` executions in the entrypoint. For instance, you could use `ENTRYPOINT_EXEC=java` so container executions would always be executing `java`.
### Extensible Certificate Authority
This image detects files in the path described by the `CACERT_INSTALL_PATH` environment variable. If a file is found, it will treat it as a certificate and add it to the trusted certificates in all supported contexts.
@@ -26,6 +28,7 @@ This image detects files in the path described by the `CACERT_INSTALL_PATH` envi
| Name | Default | Mutable |
| ---------------------------- | --------------- |:-------:|
| `SKIP_ENTRYPOINT_SCRIPTS` | `false` | Yes |
| `ENTRYPOINT_EXEC` | *none* | Yes |
| `VERBOSE` | `true` | Yes |
| `CONTAINERD_ENTRYPOINT_PATH` | *not important* | No |
| `CACERT_INSTALL_PATH` | *not important* | No |
+7 -2
View File
@@ -35,7 +35,12 @@ if ! find ${CACERT_INSTALL_PATH}/ -maxdepth 0 -empty | read JUNK; then
update-ca-certificates
fi
if [[ ! -z $1 ]]; then
if [[ -z ${ENTRYPOINT_EXEC} ]]; then
if [[ ! -z $1 ]]; then
ifecho "Executing command ..."
exec "$@"
fi
else
ifecho "Executing command ..."
exec "$@"
exec "${ENTRYPOINT_EXEC} $@"
fi