Skip to content

Commit

Permalink
Use tini for UBI8 images to ensure correct termination
Browse files Browse the repository at this point in the history
  • Loading branch information
emerkle826 committed Oct 27, 2023
1 parent c46d8f9 commit 4078691
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
7 changes: 6 additions & 1 deletion Dockerfile-4_0.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ RUN mkdir -m 775 ${MAAC_PATH} \
############################################################

FROM registry.access.redhat.com/ubi${UBI_MAJOR}/ubi-minimal:${UBI_BASETAG} as oss40
ARG TARGETARCH
ARG CASSANDRA_VERSION
ENV CASSANDRA_VERSION=${CASSANDRA_VERSION}

Expand Down Expand Up @@ -152,6 +153,10 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
# fix for the missing mtab in the containerd
ln -sf /proc/mounts /etc/mtab

ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini
RUN chmod +x /tini

# Set user to run as
USER cassandra

Expand All @@ -164,5 +169,5 @@ EXPOSE 8080 9103 9000
# CASSANDRA PORTS (INTRA-NODE, TLS INTRA-NODE, JMX, CQL, THRIFT, DSEFS INTRA-NODE, INTRA-NODE MESSAGING SERVICE)
EXPOSE 7000 7001 7199 8609 9042 9160

ENTRYPOINT ["/docker-entrypoint.sh"]
ENTRYPOINT ["/tini", "-g", "--", "/docker-entrypoint.sh"]
CMD ["mgmtapi"]
7 changes: 6 additions & 1 deletion Dockerfile-4_1.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ RUN mkdir -m 775 ${MAAC_PATH} \
############################################################

FROM registry.access.redhat.com/ubi${UBI_MAJOR}/ubi-minimal:${UBI_BASETAG} AS oss41
ARG TARGETARCH
ARG CASSANDRA_VERSION
ENV CASSANDRA_VERSION=${CASSANDRA_VERSION}

Expand Down Expand Up @@ -153,6 +154,10 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
# fix for the missing mtab in the containerd
ln -sf /proc/mounts /etc/mtab

ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini
RUN chmod +x /tini

# Set user to run as
USER cassandra

Expand All @@ -165,5 +170,5 @@ EXPOSE 8080 9103 9000
# CASSANDRA PORTS (INTRA-NODE, TLS INTRA-NODE, JMX, CQL, THRIFT, DSEFS INTRA-NODE, INTRA-NODE MESSAGING SERVICE)
EXPOSE 7000 7001 7199 8609 9042 9160

ENTRYPOINT ["/docker-entrypoint.sh"]
ENTRYPOINT ["/tini", "-g", "--", "/docker-entrypoint.sh"]
CMD ["mgmtapi"]
7 changes: 6 additions & 1 deletion Dockerfile-oss.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ RUN mkdir -m 775 ${MAAC_PATH} \
############################################################

FROM registry.access.redhat.com/ubi${UBI_MAJOR}/ubi-minimal:${UBI_BASETAG} as oss311
ARG TARGETARCH
ARG CASSANDRA_VERSION
ENV CASSANDRA_VERSION=${CASSANDRA_VERSION}

Expand Down Expand Up @@ -152,6 +153,10 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
# fix for the missing mtab in the containerd
ln -sf /proc/mounts /etc/mtab

ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini
RUN chmod +x /tini

# Set user to run as
USER cassandra

Expand All @@ -164,5 +169,5 @@ EXPOSE 8080 9103 9000
# CASSANDRA PORTS (INTRA-NODE, TLS INTRA-NODE, JMX, CQL, THRIFT, DSEFS INTRA-NODE, INTRA-NODE MESSAGING SERVICE)
EXPOSE 7000 7001 7199 8609 9042 9160

ENTRYPOINT ["/docker-entrypoint.sh"]
ENTRYPOINT ["/tini", "-g", "--", "/docker-entrypoint.sh"]
CMD ["mgmtapi"]
7 changes: 6 additions & 1 deletion cassandra-trunk/Dockerfile.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ RUN mkdir -m 775 ${MAAC_PATH} \
############################################################

FROM registry.access.redhat.com/ubi${UBI_MAJOR}/ubi-minimal:${UBI_BASETAG} as cass-trunk
ARG TARGETARCH
ARG CASSANDRA_VERSION
ENV CASSANDRA_VERSION=${CASSANDRA_VERSION}

Expand Down Expand Up @@ -170,6 +171,10 @@ RUN (for dir in ${CASSANDRA_DATA_DIR} \
# change mode of directories
chmod a+rwX ${MAAC_PATH} ${MCAC_PATH} ${CASSANDRA_PATH} ${CDC_AGENT_PATH} /etc/cassandra

ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini
RUN chmod +x /tini

# Set user to run as
USER cassandra

Expand All @@ -182,5 +187,5 @@ EXPOSE 8080 9103 9000
# CASSANDRA PORTS (INTRA-NODE, TLS INTRA-NODE, JMX, CQL, THRIFT, DSEFS INTRA-NODE, INTRA-NODE MESSAGING SERVICE)
EXPOSE 7000 7001 7199 8609 9042 9160

ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/tini", "-g", "--", "/entrypoint.sh"]
CMD ["mgmtapi"]

0 comments on commit 4078691

Please sign in to comment.