Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
entrypoint: Launch our entrypoint via tini
Even single process containers (which this one is actually not) should
have an init system. However most init systems are too big and complex
for containerization purposes. [Dumb-init][0] (and tini init) address
this problem _specifically_ for Docker containers.

See the [dumb-init][0] documentation for more details.

[0]: https://github.com/Yelp/dumb-init

Signed-off-by: Olliver Schinagl <[email protected]>
  • Loading branch information
oliv3r committed Jun 10, 2023
commit e7e1b3c8134b3274125b1dcd18883511a0ea0a8d
3 changes: 3 additions & 0 deletions Dockerfile-alpine-slim.template
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ RUN set -x \
# forward request and error logs to docker log collector
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
# Ensure we can run our entrypoint and make it debian compatible
&& apk add --no-cache tini \
&& ln -s /sbin/tini /usr/bin/tini \
# create a docker-entrypoint.d directory
&& mkdir /docker-entrypoint.d

Expand Down
5 changes: 4 additions & 1 deletion Dockerfile-alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@ RUN set -x \
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
# Bring in curl and ca-certificates to make registering on DNS SD easier
&& apk add --no-cache curl ca-certificates
&& apk add --no-cache curl ca-certificates \
# Ensure we can run our entrypoint and do it compatible with alpine
&& apk add --no-cache tini \
&& ln -s /sbin/tini /usr/bin/tini
2 changes: 2 additions & 0 deletions Dockerfile-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ RUN set -x \
$nginxPackages \
gettext-base \
curl \
tini \
&& ln -s /usr/bin/tini /sbin/tini \
&& apt-get remove --purge --auto-remove -y && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list \
\
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
Expand Down
2 changes: 1 addition & 1 deletion entrypoint/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/sbin/init /bin/sh
# vim:sw=4:ts=4:et

set -e
Expand Down