FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and dependencies for XGBoost C++ build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
ca-certificates \
unzip \
libssl-dev \
libz-dev \
libbz2-dev \
liblzma-dev \
libncurses5-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create workspace and copy source
WORKDIR /workspace
COPY . .
# Build the project from source
RUN mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && \
cmake --build . -j$(nproc)
# Expose build artifacts via a cwd-based view (no install step by default)
# The container will drop into a shell by default for convenience
CMD ["/bin/bash"]
/.git /.github /build python-package *.pyc __pycache__ *.swp *.swo
Summary (under 1500 chars)
Status
- VerifyBuild status: build_failed
Concerns
- No explicit install step; built artifacts remain in /workspace/build and are not installed into system directories.
- COPY . . may copy large or sensitive files; adding a .dockerignore would help keep the image lean and secure.
- Potential missing dependencies (e.g., BLAS/OpenMP-related); may affect build fragility.
Build error (failing step and exact command)
- Failing command/step:
[5/5] RUN mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && cmake --build . -j$(nproc)
- Exact error messages and exit code:
CMake Error at CMakeLists.txt:297 (add_subdirectory):
The source directory
/workspace/dmlc-core
does not contain a CMakeLists.txt file.
CMake Error at cmake/Utils.cmake:185 (set_target_properties):
set_target_properties Can not find target to add properties to: dmlc
Call Stack (most recent call first):
CMakeLists.txt:412 (xgboost_target_properties)
CMake Error at cmake/Utils.cmake:271 (target_link_libraries):
Cannot specify link libraries for target "dmlc" which is not built by this
project.
Call Stack (most recent call first):
CMakeLists.txt:413 (xgboost_target_link_libraries)
-- Configuring incomplete, errors occurred!
See also "/workspace/build/CMakeFiles/CMakeOutput.log".
The overall exit code for this step is 1 (exit code: 1).
Missing packages/files
- Missing file: The source directory /workspace/dmlc-core does not contain a CMakeLists.txt file.
Version & environment details
- Base image: Ubuntu 22.04
- CMake: 3.22.1
- C/C++ compiler: GNU 11.4.0
- xgboost version: 3.3.0
- Build step: -DUSE_OPENMP=ON
Summary of cause
- The build fails during CMake configuration because /workspace/dmlc-core is missing its CMakeLists.txt, leaving targets like dmlc undefined and causing subsequent set_target_properties/target_link_libraries errors. Result: “Configuring incomplete, errors occurred!” and exit code 1.FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and dependencies for XGBoost C++ build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
ca-certificates \
unzip \
libssl-dev \
libz-dev \
libbz2-dev \
liblzma-dev \
libncurses5-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create workspace and copy source
WORKDIR /workspace
COPY . .
# Ensure submodules are initialized (some parts may be vendored as submodules)
RUN git submodule update --init --recursive || true
# Build the project from source
RUN mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && \
cmake --build . -j$(nproc)
# Expose build artifacts via a cwd-based view (no install step by default)
# The container will drop into a shell by default for convenience
CMD ["/bin/bash"]
Failing step (Docker build step): - RUN mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && cmake --build . -j$(nproc) Exact error message and exit code: - CMake Error at CMakeLists.txt:297 (add_subdirectory): The source directory /workspace/dmlc-core does not contain a CMakeLists.txt file. - CMake Error at cmake/Utils.cmake:185 (set_target_properties): set_target_properties Can not find target to add properties to: dmlc - CMake Error at cmake/Utils.cmake:271 (target_link_libraries): Cannot specify link libraries for target "dmlc" which is not built by this project. - -- Configuring incomplete, errors occurred! - See also "/workspace/build/CMakeFiles/CMakeOutput.log". - The process did not complete successfully: exit code: 1 - The final Docker command exit: 1 Missing packages/files mentioned: - The build expects a CMakeLists.txt in /workspace/dmlc-core (the directory "/workspace/dmlc-core" does not contain a CMakeLists.txt file). Version information / potential mismatches: - Base image: Ubuntu 22.04 - CMake version: 3.22.1 - C/C++ compiler: GNU 11.4.0 - xgboost VERSION: 3.3.0 Notes: - Earlier step attempted to update git submodules but failed with “fatal: not a git repository (or any of the parent directories): .git” (not the failing step). The root cause of the build failure is the missing CMakeLists.txt in /workspace/dmlc-core.
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and dependencies for XGBoost C++ build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
ca-certificates \
unzip \
libssl-dev \
libz-dev \
libbz2-dev \
liblzma-dev \
libncurses5-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create workspace and copy source
WORKDIR /workspace
COPY . .
# Ensure dmlc-core is populated (fetch if needed)
RUN if [ -d dmlc-core ]; then \
if [ -z "$(ls -A dmlc-core)" ]; then \
git clone --recursive https://github.com/dmlc/dmlc-core.git dmlc-core; \
fi; \
else \
git clone --recursive https://github.com/dmlc/dmlc-core.git dmlc-core; \
fi
# Build the project from source
RUN mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && \
cmake --build . -j$(nproc)
# Expose build artifacts via a cwd-based view (no install step by default)
# The container will drop into a shell by default for convenience
CMD ["/bin/bash"]
Concerns: No explicit install step: built artifacts remain under /workspace/build rather than being installed to a system path, which may be inconvenient for downstream usage., COPY . . copies the entire repo into the image; if the build context is large, this can bloat the image and slow builds. Consider restricting to necessary files or using a multi-stage build., The build relies on an internet fetch for dmlc-core if not present; this can fail in restricted environments. Consider vendoring or submodule management for reproducible builds. Smoke [PASS]: test -f /workspace/build/CMakeCache.txt Smoke [PASS]: test -f /workspace/build/Makefile Smoke [FAIL]: bash -lc 'if [ -n "$(find /workspace/build -type f -name \"*.so\" -o -name \"*.a\" -o -name \"*.exe\" 2>/dev/null | head -n 1)" ]; then exit 0; else exit 1; fi Output: sh: 1: Syntax error: Unterminated quoted string
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and dependencies for XGBoost C++ build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
ca-certificates \
unzip \
libssl-dev \
libz-dev \
libbz2-dev \
liblzma-dev \
libncurses5-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create workspace and copy source
WORKDIR /workspace
COPY . .
# Ensure dmlc-core is populated (fetch if needed)
RUN if [ -d dmlc-core ]; then \
if [ -z "$(ls -A dmlc-core)" ]; then \
git clone --recursive https://github.com/dmlc/dmlc-core.git dmlc-core; \
fi; \
else \
git clone --recursive https://github.com/dmlc/dmlc-core.git dmlc-core; \
fi
# Build the project from source
RUN mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && \
cmake --build . -j$(nproc)
# Copy any built artifacts (.so, .a, .exe) into /workspace/build so the smoke test can discover them
RUN mkdir -p /workspace/build && \
cd build && \
bash -lc 'set -e; find . -type f \( -name "*.so" -o -name "*.a" -o -name "*.exe" \) -exec cp {} /workspace/build/ \;' || true
# Expose build artifacts via a cwd-based view (no install step by default)
# The container will drop into a shell by default for convenience
CMD ["/bin/bash"]
Concerns: OpenMP support may fail if the OpenMP development headers/runtime are not installed; add apt-get install -y libomp-dev (and/or libgomp1) to ensure USE_OPENMP=ON builds succeed across environments. Smoke [PASS]: test -f /workspace/build/CMakeCache.txt Smoke [FAIL]: bash -lc 'set -e; if ls /workspace/build/*.so /workspace/build/*.a /workspace/build/*.exe 2>/dev/null; then echo built-artifacts-found; else echo no-artifacts; exit 1; fi Output: sh: 1: Syntax error: Unterminated quoted string Smoke [PASS]: ls -la /workspace/build | head -n 5
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and dependencies for XGBoost C++ build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
ca-certificates \
unzip \
libssl-dev \
libz-dev \
libbz2-dev \
liblzma-dev \
libncurses5-dev \
pkg-config \
libomp-dev \
&& rm -rf /var/lib/apt/lists/*
# Create workspace and copy source
WORKDIR /workspace
COPY . .
# Build the project from source
RUN mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && \
cmake --build . -j$(nproc) && \
-n 1
# Install built artifacts into /usr/local (if build succeeded)
RUN cd build && make install || true
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies (keep to a minimum)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libssl-dev \
libz-dev \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local /usr/local
ENV PATH=/usr/local/bin:$PATH
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
WORKDIR /workspace
CMD ["/bin/bash"]
Concerns: The RUN step contains a stray '-n 1' which is not a valid command and will cause the build to fail., The 'cmake --build' is followed by ' && -n 1', breaking the shell instruction., The install step uses '|| true', which masks failures to build/install, potentially leaving a broken image., Runtime image misses OpenMP runtime (libgomp1) which is needed for USE_OPENMP=ON; may fail at runtime., Runtime image installs development headers (libssl-dev, libz-dev) instead of minimal runtime libraries.
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and dependencies for XGBoost C++ build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
ca-certificates \
unzip \
libssl-dev \
libz-dev \
libbz2-dev \
liblzma-dev \
libncurses5-dev \
pkg-config \
libomp-dev \
&& rm -rf /var/lib/apt/lists/*
# Create workspace and copy source
WORKDIR /workspace
COPY . .
# Build the project from source
RUN mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && \
cmake --build . -j$(nproc) && \
# Copy artifacts to /usr/local after build is done
cmake --install .
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies (keep to a minimum)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libssl-dev \
libz-dev \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local /usr/local
ENV PATH=/usr/local/bin:$PATH
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
WORKDIR /workspace
CMD ["/bin/bash"]
Actionable summary:
- VerifyBuild status: build_failed
- Build concerns (runtime/environment):
- Final stage installs development packages libssl-dev and libz-dev; at runtime, libraries may be missing (e.g., libssl3, libgomp1).
- If USE_OPENMP=ON, an OpenMP runtime (e.g., libgomp1) may be required at runtime but not installed in final image.
- Runtime image includes development headers (libssl-dev); consider runtime-only packages (e.g., libssl3) to reduce image size and ensure runtime behavior.
- Build attempt command:
mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && cmake --build . -j$(nproc) && cmake --install .
- Exact errors encountered:
- CMakeLists.txt:297 (add_subdirectory): The source directory /work Space/dmlc-core does not contain a CMakeLists.txt file.
- CMake Error at cmake/Utils.cmake:185 (set_target_properties): set_target_properties Can not find target to add properties to: dmlc
- CMake Error at cmake/Utils.cmake:271 (target_link_libraries): Cannot specify link libraries for target "dmlc" which is not built by this project.
- Configuring incomplete, errors occurred! See also "/workspace/build/CMakeFiles/CMakeOutput.log".
- The overall build command failed with exit code 1:
ERROR: failed to build: failed to solve: process "/bin/sh -c mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && cmake --build . -j$(nproc) && cmake --install ." did not complete successfully: exit code: 1
- Missing file/directory:
- /workspace/dmlc-core does not contain a CMakeLists.txt file.
- Version information:
- CMake version: 3.22.1
- C/C++ compiler: GNU 11.4.0
- xgboost version detected in build: 3.3.0
- Note:
- The failure is due to the missing CMakeLists.txt in /workspace/dmlc-core; no explicit version mismatch reported.FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and dependencies for XGBoost C++ build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
ca-certificates \
unzip \
libssl-dev \
libz-dev \
libbz2-dev \
liblzma-dev \
libncurses5-dev \
pkg-config \
libomp-dev \
&& rm -rf /var/lib/apt/lists/*
# Create workspace and copy source
WORKDIR /workspace
COPY . .
# Ensure dmlc-core is populated (fetch if needed)
RUN if [ -d dmlc-core ]; then \
if [ -z "$(ls -A dmlc-core 2>/dev/null)" ]; then \
git clone --depth 1 --recursive https://github.com/dmlc/dmlc-core.git dmlc-core; \
fi; \
else \
git clone --depth 1 --recursive https://github.com/dmlc/dmlc-core.git dmlc-core; \
fi
# Build the project from source
RUN mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON .. && \
cmake --build . -j$(nproc) && \
cmake --install .
FROM ubuntu:22.04 AS runtime
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies (keep to a minimum)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libssl3 \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local /usr/local
ENV PATH=/usr/local/bin:$PATH
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
WORKDIR /workspace
CMD ["/bin/bash"]