Skip to content

Commit 7d31c6d

Browse files
author
shikharbhardwaj
committed
Add tini to allow termination signal handling
1 parent 9720afd commit 7d31c6d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

docker/release/dockerfiles/opensearch-dashboards.al2.dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,17 @@ FROM amazonlinux:2
5252
ARG UID=1000
5353
ARG GID=1000
5454
ARG OPENSEARCH_DASHBOARDS_HOME=/usr/share/opensearch-dashboards
55+
ENV TINI_VERSION=v0.19.0
5556

5657
# Update packages
5758
# Install the tools we need: tar and gzip to unpack the OpenSearch tarball, and shadow-utils to give us `groupadd` and `useradd`.
5859
# Install which to allow running of securityadmin.sh
5960
RUN yum update -y && yum install -y tar gzip shadow-utils which && yum clean all
6061

62+
# Add tini to use as init (PID1) process.
63+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
64+
RUN chmod +x /bin/tini
65+
6166
# Install Reporting dependencies
6267
RUN yum install -y libnss3.so xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc fontconfig freetype && yum clean all
6368

@@ -93,5 +98,5 @@ LABEL org.label-schema.schema-version="1.0" \
9398
org.label-schema.build-date="$BUILD_DATE"
9499

95100
# CMD to run
96-
ENTRYPOINT ["./opensearch-dashboards-docker-entrypoint.sh"]
101+
ENTRYPOINT ["tini", "--", "./opensearch-dashboards-docker-entrypoint.sh"]
97102
CMD ["opensearch-dashboards"]

docker/release/dockerfiles/opensearch.al2.dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@ FROM amazonlinux:2
5454
ARG UID=1000
5555
ARG GID=1000
5656
ARG OPENSEARCH_HOME=/usr/share/opensearch
57+
ENV TINI_VERSION=v0.19.0
5758

5859
# Update packages
5960
# Install the tools we need: tar and gzip to unpack the OpenSearch tarball, and shadow-utils to give us `groupadd` and `useradd`.
6061
# Install which to allow running of securityadmin.sh
6162
RUN yum update -y && yum install -y tar gzip shadow-utils which && yum clean all
6263

64+
# Add tini to use as init (PID1) process.
65+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
66+
RUN chmod +x /bin/tini
67+
6368
# Create an opensearch user, group
6469
RUN groupadd -g $GID opensearch && \
6570
adduser -u $UID -g $GID -d $OPENSEARCH_HOME opensearch
@@ -107,5 +112,5 @@ LABEL org.label-schema.schema-version="1.0" \
107112
org.label-schema.build-date="$BUILD_DATE"
108113

109114
# CMD to run
110-
ENTRYPOINT ["./opensearch-docker-entrypoint.sh"]
115+
ENTRYPOINT ["tini", "--", "./opensearch-docker-entrypoint.sh"]
111116
CMD ["opensearch"]

0 commit comments

Comments
 (0)