Files
minicalosim/docker/Dockerfile-mini
T
lars 4ffb2f78b8 extend Steps ntuple and switch Docker to Geant4 submodule source
Add 15 new columns to the Steps ntuple: edep, step_length, parent_id,
process name, layer_id, material, pre-step momentum direction, and
B/E field components (in T and V/m) at the pre-step point.

Replace wget Geant4 tarball download in all three Dockerfiles with
ADD of the lib/geant4 submodule source; narrow submodule init to
lib/pybind11 only so builds no longer require network access for Geant4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 16:07:17 +02:00

66 lines
1.9 KiB
Plaintext

FROM ubuntu:22.04
SHELL ["/bin/bash", "-c"]
USER root
ENV DEBIAN_FRONTEND=noninteractive
# Build tools + minimal Python
RUN apt-get update -y && apt-get install -y \
python3 python3-dev python3-pip \
cmake g++ gcc binutils \
libssl-dev wget git \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install numpy pandas uproot awkward plotly ipython && \
ln -sf /usr/bin/python3 /usr/bin/python
# Geant4 — build from submodule source (batch mode only, no visualization, no multithreading)
ADD minicalosim/lib/geant4 /tmp/geant4-src
RUN cmake \
-S /tmp/geant4-src \
-B /tmp/geant4-build \
-DCMAKE_INSTALL_PREFIX=/opt/geant4-v11.1.2 \
-DCMAKE_RULE_MESSAGES=OFF \
-DGEANT4_INSTALL_DATA=ON \
-DGEANT4_BUILD_MULTITHREADED=OFF \
-DGEANT4_BUILD_TLS_MODEL=global-dynamic \
> /dev/null && \
cmake --build /tmp/geant4-build --parallel $(nproc) > /dev/null && \
cmake --install /tmp/geant4-build > /dev/null && \
rm -rf /tmp/geant4-src /tmp/geant4-build
ENV LD_LIBRARY_PATH="/opt/geant4-v11.1.2/lib"
# Build minicalo
ARG BUILD_DATE
ARG COMMIT
ARG USER
LABEL org.label-schema.build-date=$BUILD_DATE
ADD minicalosim /root/minicalosim
RUN cd /root/minicalosim && git checkout $COMMIT && \
git submodule update --init lib/pybind11 && \
cmake \
-S . -B build \
-DWITH_GEANT4_UIVIS=OFF \
> /dev/null && \
cmake --build build --parallel $(nproc) && \
cp build/minicalo*.so /usr/local/lib/python3.10/dist-packages/
RUN cp /root/minicalosim/bind/G4Calo.py \
/root/minicalosim/bind/minicalo_tools.py \
/root/minicalosim/bind/minipandas.py \
/usr/local/lib/python3.10/dist-packages/ && \
install -m 755 /root/minicalosim/bind/G4Calo_exec.py /usr/local/bin/G4Calo_exec.py
# Copy examples
RUN cp -r /root/minicalosim/bind /examples && \
rm -rf /root/minicalosim
WORKDIR /examples
CMD ["bash"]