From c3246ba8760bc171e8fa4a5c40b6400c3b340b85 Mon Sep 17 00:00:00 2001 From: 0xaatif Date: Wed, 3 Jul 2024 16:09:48 +0100 Subject: [PATCH] feat: build target for each binary --- Dockerfile | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index c05e80c53..df16083c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,12 @@ # This is loosely based on `docker init`'s rust template. # For a completely clean build, run something like this: # ``` -# docker build --build-arg=PROFILE=dev --build-arg=ENTRYPOINT=leader --no-cache +# docker build --build-arg=PROFILE=dev --no-cache # ``` +# +# There is a build target[^1] for each artifact we want. +# +# [^1]: https://docs.docker.com/build/building/multi-stage/ ############# # Build stage @@ -71,10 +75,10 @@ find "/artifacts/$SUBDIR" \ EOF -################## -# Final executable -################## -FROM debian:bullseye-slim AS final +########################## +# Base for the final image +########################## +FROM debian:bullseye-slim AS base # Install runtime dependencies. RUN apt-get update && apt-get install -y \ @@ -84,23 +88,6 @@ RUN apt-get update && apt-get install -y \ tini \ && rm -rf /var/lib/apt/lists/* -COPY --from=build /output/* /usr/local/bin/ -RUN <