diff --git a/containerfiles/Dockerfile b/containerfiles/Dockerfile index 82060b90b0..f5fefa9845 100644 --- a/containerfiles/Dockerfile +++ b/containerfiles/Dockerfile @@ -82,5 +82,10 @@ 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"] + +# 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; \ + chmod +x /usr/local/bin/entrypoint.sh; +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]