Skip to content

Commit 8433950

Browse files
refactor: rename docker-entrypoint.{d,sh} to container-entrypoint.{d,sh}; adjust readme
Signed-off-by: Sebastian Maier <sebastian.maier@siemens.com>
1 parent 10ae7f9 commit 8433950

7 files changed

Lines changed: 40 additions & 14 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The directory structure follows the following conventions. The full path is alw
100100

101101
## Initialization Scripts
102102

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

106106
## How to Release the container

openvoxdb/Containerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ ENV \
5050

5151
ADD ssl.sh \
5252
wtfc.sh \
53+
container-entrypoint.sh \
5354
docker-entrypoint.sh \
5455
healthcheck.sh \
5556
/
5657

57-
COPY docker-entrypoint.d /docker-entrypoint.d
58+
COPY container-entrypoint.d /container-entrypoint.d
5859

5960
ADD https://apt.overlookinfratech.com/openvox${OPENVOX_RELEASE}-release-ubuntu${UBUNTU_VERSION}.deb /
6061
RUN apt-get update && \
@@ -64,7 +65,7 @@ RUN apt-get update && \
6465
RUN apt update && \
6566
apt upgrade -y && \
6667
apt install --no-install-recommends -y ${PACKAGES} && \
67-
chmod +x /ssl.sh /wtfc.sh /docker-entrypoint.sh /healthcheck.sh /docker-entrypoint.d/*.sh && \
68+
chmod +x /ssl.sh /wtfc.sh /container-entrypoint.sh /docker-entrypoint.sh /healthcheck.sh /container-entrypoint.d/*.sh && \
6869
apt install -y openvoxdb=${OPENVOXDB_VERSION} && \
6970
apt autoremove -y && \
7071
apt clean && \
@@ -92,5 +93,5 @@ HEALTHCHECK --start-period=5m --interval=10s --timeout=10s --retries=6 CMD ["/he
9293
# NOTE: this is just documentation on defaults
9394
EXPOSE 8080 8081
9495

95-
ENTRYPOINT ["dumb-init", "/docker-entrypoint.sh"]
96+
ENTRYPOINT ["dumb-init", "/container-entrypoint.sh"]
9697
CMD ["foreground"]
File renamed without changes.
File renamed without changes.

openvoxdb/docker-entrypoint.d/30-certificate-allowlist.sh renamed to openvoxdb/container-entrypoint.d/30-certificate-allowlist.sh

File renamed without changes.

openvoxdb/container-entrypoint.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
# bash is required to pass ENV vars with dots as sh cannot
3+
4+
set -e
5+
6+
echoerr() { echo "$@" 1>&2; }
7+
8+
if [ -d /docker-entrypoint.d ]; then
9+
echoerr "DEPRECATED: Use /container-entrypoint.d/ instead of /docker-entrypoint.d/"
10+
for f in /docker-entrypoint.d/*.sh; do
11+
echo "Running $f"
12+
"$f"
13+
done
14+
fi
15+
16+
for f in /container-entrypoint.d/*.sh; do
17+
echo "Running $f"
18+
"$f"
19+
done
20+
21+
if [ -d /docker-custom-entrypoint.d/ ]; then
22+
echoerr "DEPRECATED: Use /container-custom-entrypoint.d/ instead of /docker-custom-entrypoint.d/"
23+
find /docker-custom-entrypoint.d/ -type f -name "*.sh" \
24+
-exec echo Running {} \; -exec bash {} \;
25+
fi
26+
27+
if [ -d /container-custom-entrypoint.d ]; then
28+
find /container-custom-entrypoint.d/ -type f -name "*.sh" \
29+
-exec echo Running {} \; -exec bash {} \;
30+
fi
31+
32+
exec /opt/puppetlabs/bin/puppetdb "$@"

openvoxdb/docker-entrypoint.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33

44
set -e
55

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

11-
if [ -d /docker-custom-entrypoint.d/ ]; then
12-
find /docker-custom-entrypoint.d/ -type f -name "*.sh" \
13-
-exec echo Running {} \; -exec bash {} \;
14-
fi
15-
16-
exec /opt/puppetlabs/bin/puppetdb "$@"
8+
echoerr "DEPRECATED: Use /container-entrypoint.sh instead of /docker-entrypoint.sh"
9+
exec ./container-entrypoint.sh "$@"

0 commit comments

Comments
 (0)