From 6b472e1200340aec8db3b73445155846c6fc5aca Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Thu, 26 Sep 2024 16:51:19 +0200 Subject: [PATCH 1/2] feat(docker): use $TARGETBINARY as the executable name --- containerfiles/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/containerfiles/Dockerfile b/containerfiles/Dockerfile index 82060b90b0..69d1be86ce 100644 --- a/containerfiles/Dockerfile +++ b/containerfiles/Dockerfile @@ -82,5 +82,8 @@ RUN \ apt-get clean; \ rm -rf /var/lib/apt/lists/*; COPY --from=builder /build/release/$TARGETBINARY /usr/local/bin/$TARGETBINARY -RUN ln -s /usr/local/bin/$TARGETBINARY /usr/local/bin/entrypoint -ENTRYPOINT ["/usr/local/bin/entrypoint"] +ENV TARGETBINARY=$TARGETBINARY +RUN \ + printf '#!/bin/sh\nexec /usr/local/bin/$TARGETBINARY $@\n' > /usr/local/bin/entrypoint.sh; \ + chmod +x /usr/local/bin/entrypoint.sh; +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] From adc3ba4186faba82997afa59b2acc15e742c9ae9 Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Thu, 26 Sep 2024 19:09:13 +0200 Subject: [PATCH 2/2] comment dockerfile oddity --- containerfiles/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/containerfiles/Dockerfile b/containerfiles/Dockerfile index 69d1be86ce..f5fefa9845 100644 --- a/containerfiles/Dockerfile +++ b/containerfiles/Dockerfile @@ -82,6 +82,8 @@ RUN \ apt-get clean; \ rm -rf /var/lib/apt/lists/*; COPY --from=builder /build/release/$TARGETBINARY /usr/local/bin/$TARGETBINARY + +# HACK: Ensure that $TARGETBINARY is the binary name. ENV TARGETBINARY=$TARGETBINARY RUN \ printf '#!/bin/sh\nexec /usr/local/bin/$TARGETBINARY $@\n' > /usr/local/bin/entrypoint.sh; \