FROM ubuntu: jammy-20260217 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential cmake git pkg-config python3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
# Copy the entire repo into the build image
COPY . .
# Configure and build the project (default build enables CLI and core; GUI/Video disabled to keep it lean)
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DAC_BUILD_GUI=OFF \
-DAC_BUILD_VIDEO=OFF \
-DAC_BUILD_BINDING_C=OFF \
-DAC_BUILD_BINDING_PYTHON=OFF \
-DAC_BUILD_CLI=ON
RUN cmake --build build -j$(nproc)
FROM ubuntu: jammy-20260217 as runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libstdc++6 ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the built CLI executable from the builder stage
COPY --from=builder /src/build/bin/ac_cli /usr/local/bin/ac_cli
ENV LANG=C.UTF-8
ENTRYPOINT ["ac_cli"]
# Ignore git and build artifacts .git build/ CMakeFiles/ CMakeCache.txt cmake-build-* *.o *.a *.so *.exe *.log
Concerns: FROM instruction has invalid syntax: there is a space after the colon in 'ubuntu: jammy-20260217'. It should be 'ubuntu:jammy-20260217'. This will cause a build error., The same syntax issue appears in the second FROM line (runtime stage): 'FROM ubuntu: jammy-20260217 as runtime'. It should be 'FROM ubuntu:jammy-20260217 AS runtime'.
FROM ubuntu:jammy-20260217 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential cmake git pkg-config python3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
# Copy the entire repo into the build image
COPY . .
# Configure and build the project (default build enables CLI and core; GUI/Video disabled to keep it lean)
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DAC_BUILD_GUI=OFF \
-DAC_BUILD_VIDEO=OFF \
-DAC_BUILD_BINDING_C=OFF \
-DAC_BUILD_BINDING_PYTHON=OFF \
-DAC_BUILD_CLI=ON
RUN cmake --build build -j$(nproc)
FROM ubuntu:jammy-20260217 AS runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libstdc++6 ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the built CLI executable from the builder stage
COPY --from=builder /src/build/bin/ac_cli /usr/local/bin/ac_cli
ENV LANG=C.UTF-8
ENTRYPOINT ["ac_cli"]
- Status: VerifyBuild status: build_failed - Key issue: SSL certificate verification failure during Git clone of ruapu.git via HTTPS in FetchContent. CAfile: none CRLfile: none (appeared multiple times) - Failing step: - builder 5/6: RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DAC_BUILD_GUI=OFF -DAC_BUILD_VIDEO=OFF -DAC_BUILD_BINDING_C=OFF -DAC_BUILD_BINDING_PYTHON=OFF -DAC_BUILD_CLI=ON - Exact error messages: - fatal: unable to access 'https://github.com/nihui/ruapu.git/': server certificate verification failed. CAfile: none CRLfile: none - Build step for ruapu failed: 2 - CMake Error at ruapu-subbuild/ruapu-populate-prefix/tmp/ruapu-populate-gitclone.cmake:31 (message): Failed to clone repository: 'https://github.com/nihui/ruapu.git' - CMake Error at /usr/share/cmake-3.22/Modules/FetchContent.cmake:1087 (message): Build step for ruapu failed: 2 - Configuring incomplete, errors occurred! - The overall Docker build reported: failed to solve: process "/bin/sh -c cmake ..." did not complete successfully: exit code: 1 - Missing files/packages: None reported locally missing; issue is SSL/TLS verification during remote fetch - Version info / mismatches: - The CXX compiler identified as GNU 11.4.0 during the cmake configure step - Clone failure is independent of compiler versions; SSL certificate verification (CAfile: none CRLfile: none) - Context: Occurs while FetchContent tries to populate ruapu via HTTPS, causing cmake configure to fail and abort the build - Quick fixes (actionable): - Ensure the image/host has a valid CA certificate store (install/update ca-certificates) - Consider alternative fetch: use SSH URL with proper keys or a trusted TLS setup - Avoid disabling certificate verification (not recommended) - Optional: add .dockerignore to reduce build context and avoid shipping unnecessary files - References (paths/URLs): - https://github.com/nihui/ruapu.git - ruapu-subbuild/ruapu-populate-prefix/tmp/ruapu-populate-gitclone.cmake - /usr/share/cmake-3.22/Modules/FetchContent.cmake - The failing command: cmake (as invoked in the RUN step)
FROM ubuntu:jammy-20260217 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential cmake git pkg-config python3 ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
# Copy the entire repo into the build image
COPY . .
# Configure and build the project (default build enables CLI and core; GUI/Video disabled to keep it lean)
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DAC_BUILD_GUI=OFF \
-DAC_BUILD_VIDEO=OFF \
-DAC_BUILD_BINDING_C=OFF \
-DAC_BUILD_BINDING_PYTHON=OFF \
-DAC_BUILD_CLI=ON
RUN cmake --build build -j$(nproc)
FROM ubuntu:jammy-20260217 AS runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libstdc++6 ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the built CLI executable from the builder stage
COPY --from=builder /src/build/bin/ac_cli /usr/local/bin/ac_cli
ENV LANG=C.UTF-8
ENTRYPOINT ["ac_cli"]
Concerns: Runtime image may miss some runtime dependencies (e.g., libgcc1) required by the dynamically linked ac_cli; consider installing libgcc1 (and potentially others) in the runtime stage., Using a specific base tag (ubuntu:jammy-20260217) is valid if it exists, but a more general tag like ubuntu:22.04 or a digest would be more reproducible. Smoke [PASS]: test -x /usr/local/bin/ac_cli Smoke [PASS]: /usr/local/bin/ac_cli --help 2>&1 | head -n 1