Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce proper init system (/bin/tini) to Docker container #22137

Merged
merged 6 commits into from
Dec 8, 2020
Merged
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
13 changes: 12 additions & 1 deletion dev-tools/packaging/templates/docker/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ LABEL \
ENV ELASTIC_CONTAINER "true"
ENV PATH={{ $beatHome }}:$PATH

# Add an init process, check the checksum to make sure it's a match
RUN set -e ; \
TINI_VERSION='v0.19.0' ; \
TINI_BIN='tini-amd64' ; \
jsoriano marked this conversation as resolved.
Show resolved Hide resolved
curl --retry 8 -S -L -O "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/${TINI_BIN}" ; \
curl --retry 8 -S -L -O "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/${TINI_BIN}.sha256sum" ; \
mieciu marked this conversation as resolved.
Show resolved Hide resolved
sha256sum -c "${TINI_BIN}.sha256sum" ; \
rm "${TINI_BIN}.sha256sum" ; \
mv "${TINI_BIN}" /bin/tini ; \
chmod +x /bin/tini

COPY docker-entrypoint /usr/local/bin/docker-entrypoint
RUN chmod 755 /usr/local/bin/docker-entrypoint

Expand All @@ -80,5 +91,5 @@ EXPOSE {{ $port }}
{{- end }}

WORKDIR {{ $beatHome }}
ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/docker-entrypoint"]
mieciu marked this conversation as resolved.
Show resolved Hide resolved
CMD ["-environment", "container"]