Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The directory structure follows the following conventions. The full path is alw

## Initialization Scripts

If you would like to do additional initialization, add a directory called `/docker-custom-entrypoint.d/` and fill it with `.sh` scripts.
If you would like to do additional initialization, add a directory called `/container-custom-entrypoint.d/` and fill it with `.sh` scripts.
These scripts will be executed at the end of the entrypoint script, before the service is ran.

## How to Release the container
Expand Down
7 changes: 4 additions & 3 deletions openvoxdb/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
ARG SSLDIR
ENV SSLDIR=${SSLDIR:-/opt/puppetlabs/server/data/puppetdb/certs}

ENV \

Check warning on line 31 in openvoxdb/Containerfile

View workflow job for this annotation

GitHub Actions / Scan CI container (8, 8.9.1-1+ubuntu24.04)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENVOXDB_POSTGRES_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 31 in openvoxdb/Containerfile

View workflow job for this annotation

GitHub Actions / Build test container (8, 8.9.1-1+ubuntu24.04)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENVOXDB_POSTGRES_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
CERTNAME="openvoxdb" \
DEBIAN_FRONTEND=noninteractive \
DNS_ALT_NAMES="" \
Expand All @@ -50,11 +50,12 @@

ADD ssl.sh \
wtfc.sh \
container-entrypoint.sh \
docker-entrypoint.sh \
healthcheck.sh \
/

COPY docker-entrypoint.d /docker-entrypoint.d
COPY container-entrypoint.d /container-entrypoint.d

ADD https://apt.overlookinfratech.com/openvox${OPENVOX_RELEASE}-release-ubuntu${UBUNTU_VERSION}.deb /
RUN apt-get update && \
Expand All @@ -64,7 +65,7 @@
RUN apt update && \
apt upgrade -y && \
apt install --no-install-recommends -y ${PACKAGES} && \
chmod +x /ssl.sh /wtfc.sh /docker-entrypoint.sh /healthcheck.sh /docker-entrypoint.d/*.sh && \
chmod +x /ssl.sh /wtfc.sh /container-entrypoint.sh /docker-entrypoint.sh /healthcheck.sh /container-entrypoint.d/*.sh && \
apt install -y openvoxdb=${OPENVOXDB_VERSION} && \
apt autoremove -y && \
apt clean && \
Expand Down Expand Up @@ -92,5 +93,5 @@
# NOTE: this is just documentation on defaults
EXPOSE 8080 8081

ENTRYPOINT ["dumb-init", "/docker-entrypoint.sh"]
ENTRYPOINT ["dumb-init", "/container-entrypoint.sh"]
CMD ["foreground"]
32 changes: 32 additions & 0 deletions openvoxdb/container-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# bash is required to pass ENV vars with dots as sh cannot

set -e

echoerr() { echo "$@" 1>&2; }

if [ -d /docker-entrypoint.d ]; then
echoerr "DEPRECATED: Use /container-entrypoint.d/ instead of /docker-entrypoint.d/"
for f in /docker-entrypoint.d/*.sh; do
echo "Running $f"
"$f"
done
fi

for f in /container-entrypoint.d/*.sh; do
echo "Running $f"
"$f"
done

if [ -d /docker-custom-entrypoint.d/ ]; then
echoerr "DEPRECATED: Use /container-custom-entrypoint.d/ instead of /docker-custom-entrypoint.d/"
find /docker-custom-entrypoint.d/ -type f -name "*.sh" \
-exec echo Running {} \; -exec bash {} \;
fi

if [ -d /container-custom-entrypoint.d ]; then
find /container-custom-entrypoint.d/ -type f -name "*.sh" \
-exec echo Running {} \; -exec bash {} \;
fi

exec /opt/puppetlabs/bin/puppetdb "$@"
13 changes: 3 additions & 10 deletions openvoxdb/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@

set -e

for f in /docker-entrypoint.d/*.sh; do
echo "Running $f"
"$f"
done
echoerr() { echo "$@" 1>&2; }

if [ -d /docker-custom-entrypoint.d/ ]; then
find /docker-custom-entrypoint.d/ -type f -name "*.sh" \
-exec echo Running {} \; -exec bash {} \;
fi

exec /opt/puppetlabs/bin/puppetdb "$@"
echoerr "DEPRECATED: Use /container-entrypoint.sh instead of /docker-entrypoint.sh"
exec ./container-entrypoint.sh "$@"
Loading