From ed1b9ce3043e3def3f1156b15117da2e410bde5e Mon Sep 17 00:00:00 2001 From: multi-stager <133181681+multi-stager@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:11:48 +0800 Subject: [PATCH] Update Dockerfile to Multi-Stage --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0440e56a88..55cc0841f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ # syntax=docker/dockerfile:1 +### Build stage # Use the latest Ubuntu base image -FROM ubuntu:latest +FROM ubuntu:latest AS builder # Set the working directory inside the container WORKDIR /workspaces/cups @@ -21,5 +22,9 @@ COPY . /root/cups WORKDIR /root/cups RUN ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var && make clean && make && make install +### Runtime stage +FROM ubuntu:latest +COPY --from=builder /root/cups /root/cups +WORKDIR /root/cups # Expose port 631 for CUPS web interface EXPOSE 631 -- 2.47.2