Skip to content

Commit

Permalink
Wrap entrypoint with tini
Browse files Browse the repository at this point in the history
Tini is a tiny "init-system" which handles signal forwarding to child
processes and most importantly handles reaping child processes.

Read more about it at

https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/
krallin/tini#8
https://github.com/docker-library/official-images#init
  • Loading branch information
spacecowboy committed Mar 14, 2018
1 parent 288f5ae commit 8dde1f4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/3.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM openjdk:8-jre-alpine

RUN apk add --no-cache --quiet \
bash \
curl
curl \
tini

ENV NEO4J_SHA256=%%NEO4J_SHA%% \
NEO4J_TARBALL=%%NEO4J_TARBALL%%
Expand All @@ -29,5 +30,5 @@ COPY docker-entrypoint.sh /docker-entrypoint.sh

EXPOSE 7474 7473 7687

ENTRYPOINT ["/docker-entrypoint.sh"]
ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint.sh"]
CMD ["neo4j"]
5 changes: 3 additions & 2 deletions src/3.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM openjdk:8-jre-alpine

RUN apk add --no-cache --quiet \
bash \
curl
curl \
tini

ENV NEO4J_SHA256=%%NEO4J_SHA%% \
NEO4J_TARBALL=%%NEO4J_TARBALL%%
Expand All @@ -29,5 +30,5 @@ COPY docker-entrypoint.sh /docker-entrypoint.sh

EXPOSE 7474 7473 7687

ENTRYPOINT ["/docker-entrypoint.sh"]
ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint.sh"]
CMD ["neo4j"]
5 changes: 3 additions & 2 deletions src/3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM openjdk:8-jre-alpine

RUN apk add --no-cache --quiet \
bash \
curl
curl \
tini

ENV NEO4J_SHA256=%%NEO4J_SHA%% \
NEO4J_TARBALL=%%NEO4J_TARBALL%% \
Expand Down Expand Up @@ -30,5 +31,5 @@ COPY docker-entrypoint.sh /docker-entrypoint.sh

EXPOSE 7474 7473 7687

ENTRYPOINT ["/docker-entrypoint.sh"]
ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint.sh"]
CMD ["neo4j"]
5 changes: 3 additions & 2 deletions src/3.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM openjdk:8-jre-alpine

RUN apk add --no-cache --quiet \
bash \
curl
curl \
tini

ENV NEO4J_SHA256=%%NEO4J_SHA%% \
NEO4J_TARBALL=%%NEO4J_TARBALL%% \
Expand Down Expand Up @@ -30,5 +31,5 @@ COPY docker-entrypoint.sh /docker-entrypoint.sh

EXPOSE 7474 7473 7687

ENTRYPOINT ["/docker-entrypoint.sh"]
ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint.sh"]
CMD ["neo4j"]
3 changes: 2 additions & 1 deletion test/container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM alpine

RUN apk update && apk add --no-cache curl bash util-linux grep
RUN apk update && apk add --no-cache curl bash util-linux grep tini

ENTRYPOINT ["/sbin/tini", "--"]
CMD ["bash", "-c", "while true; do sleep 120; done"]

0 comments on commit 8dde1f4

Please sign in to comment.