From 6753ebfbfc112bcddc8fda1f8e40dab3f8bfdc49 Mon Sep 17 00:00:00 2001 From: Erwan Bousse <erwan.bousse@univ-nantes.fr> Date: Sat, 21 Sep 2024 14:09:54 +0200 Subject: [PATCH] simplify to single-stage build --- Containerfile.custom | 47 ++++++-------------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/Containerfile.custom b/Containerfile.custom index fd5f70d..7e11171 100644 --- a/Containerfile.custom +++ b/Containerfile.custom @@ -1,50 +1,15 @@ -# ____ _ _ _ -# | __ ) _ _(_) | __| | ___ _ __ -# | _ \| | | | | |/ _` |/ _ \ '__| -# | |_) | |_| | | | (_| | __/ | -# |____/ \__,_|_|_|\__,_|\___|_| -# -FROM docker.io/fedora as builder - -# This will be used in ubi-micro -RUN dnf --installroot=/tmp/ubi-micro \ - --nodocs --setopt=install_weak_deps=False \ - --releasever=40 \ - install -y \ - g++ shadow-utils && \ - dnf --installroot=/tmp/ubi-micro \ - clean all +FROM docker.io/fedora -# This is needed to build pict RUN dnf install -y cmake g++ && \ mkdir /tmp/pict -# Copy repo resources -COPY ./ /tmp/pict/ +COPY ./ /pict/ -# Build the pict -RUN cd /tmp/pict/ && \ +RUN cd /pict/ && \ rm -rf build && \ cmake -DCMAKE_BUILD_TYPE=Release -S . -B build && \ - cmake --build build && \ - cp build/cli/pict /tmp/ubi-micro/usr/local/bin/ - -# __ __ _ -# | \/ | __ _(_)_ __ -# | |\/| |/ _` | | '_ \ -# | | | | (_| | | | | | -# |_| |_|\__,_|_|_| |_| -# -FROM docker.io/fedora - -COPY --from=builder /tmp/ubi-micro/ / - -VOLUME /var/pict - -WORKDIR /var/pict - -RUN useradd -M pict + cmake --build build -USER pict +WORKDIR /pict/build/cli/ -ENTRYPOINT ["pict"] +ENTRYPOINT ["pict"] \ No newline at end of file -- GitLab