From 6d9ad1058b3448ed98bb7576e6ecead366987ba6 Mon Sep 17 00:00:00 2001 From: Bernat Vadell Date: Tue, 14 Mar 2023 15:03:25 +0100 Subject: [PATCH] feat: split build & runtime stages --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6b16aa06c..a0f87de9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG UBUNTU_VERSION=22.04 -FROM ubuntu:$UBUNTU_VERSION +FROM ubuntu:$UBUNTU_VERSION as build RUN apt-get update && \ apt-get install -y build-essential python3 python3-pip @@ -14,4 +14,8 @@ COPY . . RUN make -ENTRYPOINT [ "/app/main" ] \ No newline at end of file +FROM ubuntu:$UBUNTU_VERSION as runtime + +COPY --from=build /app/main /main + +ENTRYPOINT [ "/main" ] \ No newline at end of file