From a2b9be40e71e1e969459205431ed55ac581e8c68 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Sat, 25 May 2024 18:24:49 +0530 Subject: [PATCH] docker images: clean kill using tini - PID 1 does not have default signal handlers which causes unclean shutdown of processes Signed-off-by: Lakshya Singh --- bitcoind/Dockerfile | 5 +++-- lightningd/Dockerfile | 5 +++-- txood/Dockerfile | 5 +++-- vlsd/Dockerfile | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/bitcoind/Dockerfile b/bitcoind/Dockerfile index 00c9a10..88eacae 100644 --- a/bitcoind/Dockerfile +++ b/bitcoind/Dockerfile @@ -103,7 +103,8 @@ RUN apk --no-cache add \ boost-thread \ sqlite-dev \ libevent \ - libzmq + libzmq \ + tini ARG BITCOIN_VERSION ARG BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION} @@ -129,7 +130,7 @@ VOLUME ["${BITCOIN_DATA}"] USER bitcoin -ENTRYPOINT ["/entrypoint.sh"] +ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"] RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}" diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index fee2ef5..03c8c73 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -113,7 +113,8 @@ RUN apk update && \ bind-tools \ libev-dev \ curl-dev \ - sqlite-dev + sqlite-dev \ + tini ARG LIGHTNINGD_UID=101 \ LIGHTNINGD_USER=lightning @@ -164,5 +165,5 @@ RUN pip3 install \ HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \ CMD ["/healthcheck.sh"] -ENTRYPOINT ["/entrypoint.sh"] +ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"] CMD ["lightningd"] diff --git a/txood/Dockerfile b/txood/Dockerfile index 66a10fd..58437fe 100644 --- a/txood/Dockerfile +++ b/txood/Dockerfile @@ -32,7 +32,8 @@ RUN apk update && \ libev-dev \ curl-dev \ curl \ - jq + jq \ + tini COPY --from=builder /usr/local/bin/txood /usr/bin/txood @@ -47,5 +48,5 @@ VOLUME ["${TXOO_DATA}"] HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \ CMD ["/healthcheck.sh"] -ENTRYPOINT ["/entrypoint.sh"] +ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"] CMD ["txood"] diff --git a/vlsd/Dockerfile b/vlsd/Dockerfile index 809a9aa..60baa5c 100644 --- a/vlsd/Dockerfile +++ b/vlsd/Dockerfile @@ -38,7 +38,8 @@ RUN apk update && \ build-base \ curl-dev \ protobuf \ - bind-tools + bind-tools \ + tini COPY --from=builder /usr/local/bin/vlsd2 /usr/local/bin/vlsd2 COPY --from=builder /usr/local/bin/vls-cli /usr/local/bin/vls-cli @@ -65,7 +66,7 @@ USER vls HEALTHCHECK --interval=10s --timeout=10s --start-period=10s \ CMD ["/healthcheck.sh"] -ENTRYPOINT ["/entrypoint.sh"] +ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"] RUN vlsd2 --git-desc