Skip to content

Commit

Permalink
Add tini to allow termination signal handling
Browse files Browse the repository at this point in the history
Signed-off-by: shikharbhardwaj <[email protected]>
  • Loading branch information
shikharbhardwaj committed Mar 16, 2023
1 parent 9720afd commit 86ae4f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,17 @@ FROM amazonlinux:2
ARG UID=1000
ARG GID=1000
ARG OPENSEARCH_DASHBOARDS_HOME=/usr/share/opensearch-dashboards
ENV TINI_VERSION=v0.19.0

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

# Add tini to use as init (PID1) process.
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
RUN chmod +x /bin/tini

# Install Reporting dependencies
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

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

# CMD to run
ENTRYPOINT ["./opensearch-dashboards-docker-entrypoint.sh"]
ENTRYPOINT ["tini", "--", "./opensearch-dashboards-docker-entrypoint.sh"]
CMD ["opensearch-dashboards"]
7 changes: 6 additions & 1 deletion docker/release/dockerfiles/opensearch.al2.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,17 @@ FROM amazonlinux:2
ARG UID=1000
ARG GID=1000
ARG OPENSEARCH_HOME=/usr/share/opensearch
ENV TINI_VERSION=v0.19.0

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

# Add tini to use as init (PID1) process.
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
RUN chmod +x /bin/tini

# Create an opensearch user, group
RUN groupadd -g $GID opensearch && \
adduser -u $UID -g $GID -d $OPENSEARCH_HOME opensearch
Expand Down Expand Up @@ -107,5 +112,5 @@ LABEL org.label-schema.schema-version="1.0" \
org.label-schema.build-date="$BUILD_DATE"

# CMD to run
ENTRYPOINT ["./opensearch-docker-entrypoint.sh"]
ENTRYPOINT ["tini", "--", "./opensearch-docker-entrypoint.sh"]
CMD ["opensearch"]

0 comments on commit 86ae4f1

Please sign in to comment.