From f4ba980f7c1f5b42896441923a9cff7b7d45b297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Cor=C3=A9?= Date: Fri, 20 Oct 2023 11:59:33 +0200 Subject: [PATCH] Add tini process pid 1 --- Containerfile.admin | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Containerfile.admin b/Containerfile.admin index 9c13dc7f..81845f65 100644 --- a/Containerfile.admin +++ b/Containerfile.admin @@ -21,6 +21,7 @@ RUN dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x findutils \ gcc \ git \ + gnupg2 \ jq \ libevent \ libevent-devel \ @@ -30,6 +31,7 @@ RUN dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x net-tools \ openssl \ postgresql \ + procps-ng \ python39 \ python39-pip \ rsync \ @@ -37,6 +39,7 @@ RUN dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x unzip \ vim \ wget \ + && dnf clean all \ && cd /tmp \ && TMUX_VERSION="3.3a" \ && curl --silent --location https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz -O \ @@ -44,11 +47,16 @@ RUN dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x && cd tmux-*/ \ && ./configure \ && make && make install \ - && dnf clean all \ + && TINI_VERSION=v0.19.0 \ + && curl --silent --location https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini -o /bin/tini \ + && curl --silent --location https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc -o /tmp/tini.asc \ + && gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \ + && gpg --batch --verify /tmp/tini.asc /bin/tini \ + && chmod +x /bin/tini \ && HURL_VERSION=4.1.0 \ && curl --silent --location https://github.com/Orange-OpenSource/hurl/releases/download/${HURL_VERSION}/hurl-${HURL_VERSION}-x86_64-unknown-linux-gnu.tar.gz \ | tar -xz -C /usr/local/bin --strip-components=1 --wildcards '*/hurl' '*/hurlfmt' \ - && rm -rf /tmp/* && rm -rf /var/cache/dnf/* && rm -rf /var/log/dnf* + && rm -rf /tmp/* && rm -rf /var/log/dnf* COPY --from=docker.io/migrate/migrate /usr/local/bin/migrate /usr/local/bin/migrate WORKDIR /sandbox/ @@ -59,8 +67,9 @@ COPY --from=builder /sandbox/build/sandbox-* ./ COPY --from=builder /sandbox/tools ./tools COPY --from=builder /sandbox/tests ./tests COPY --from=builder /sandbox/db ./db -CMD ["/usr/local/bin/tmux", "new-session", "-s", "sandbox", "-c", "/sandbox"] +ENTRYPOINT ["/bin/tini", "--"] +CMD ["/usr/local/bin/tmux", "new-session", "-s", "sandbox-admin", "-c", "/sandbox"] ENV DESCRIPTION="Image for Admins to interact with the Sandbox API" LABEL name="rhpds/sandbox-admin" \