From 6fb653ef9709e5e46042432f461b7efb8593be84 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 13 Oct 2022 14:36:10 +0200 Subject: [PATCH] docker: Separate builder from runner stage in alpine docker image Should result in smaller images. --- contrib/docker/Dockerfile.alpine | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/contrib/docker/Dockerfile.alpine b/contrib/docker/Dockerfile.alpine index 68e5a8a78..de571912d 100644 --- a/contrib/docker/Dockerfile.alpine +++ b/contrib/docker/Dockerfile.alpine @@ -35,5 +35,13 @@ RUN git clone /source /repo --recursive && \ make -j $(nproc) && \ make install -# TODO: review entry point here, to make this availale for the user -CMD ["lightningd", "--version"] +FROM alpine:3.16 as runner + +COPY --from=builder /usr/bin/lightningd /usr/bin/ +COPY --from=builder /usr/bin/lightning-cli /usr/bin/ +COPY --from=builder /usr/bin/lightning-hsmtool /usr/bin/ +COPY --from=builder /usr/libexec/c-lightning /usr/libexec/c-lightning +COPY --from=builder /usr/share/man/man8 /usr/share/man/man8 +COPY --from=builder /usr/share/doc/c-lightning /usr/share/doc/c-lightning + +ENTRYPOINT ["/usr/bin/lightningd"]