Skip to content

Simplified Geant4 usage with a docker container derived from a Ubuntu 18.04 ROOT container

Notifications You must be signed in to change notification settings

flome/geant-4-docker

Repository files navigation

geant-4-docker

Simplified Geant4 usage with a Docker container derived from a Ubuntu 18.04 ROOT container. The image is hosted on DockerHub

Docker can be installed following the instructions on the Docker homepage. The Docker image can also be used very well to build a Singularity container from it. Tested on CentOS7 with Singularity 3.2 successfully with graphics support wihtout the need for passing further flags.

Usage

To run the container, simply call

docker run -it --rm --name geant4_container smflment/geant-4-docker:10.5.1 bash

Options:

  • -it: Keep bash open after invoking
  • --rm: Delete container when stopping. Remove this option if you want to keep your container for more than one session
  • --name geant4_container: Name for your container.

GUI

To use the GUI, you need to pass X11 information. From Linux you can run the container using

docker run -it --rm --ipc=host --net=host \
           -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \
           -v "$HOME/.Xauthority:/root/.Xauthority:rw" \
           --name geant4_container \
           smflment/geant-4-docker:10.5.1 bash

Run example

A simple test can be performed using a simple example within the container:

cp -r $G4EXAMPLES/basic/B1 ./ && cd B1/ && mkdir build && cd build && cmake ../ && make && ./exampleB1

Bare image (currently not available)

The bare image comes without examples and datasets. You will need to download them yourself in that case and provide them using a volume adding the option

-v path/to/unpacked/datasets:/usr/local/geant4/share/Geant4-10.5.1/data

Download shortcut:

wget https://cern.ch/geant4-data/datasets/G4NDL.4.5.tar.gz \
     https://cern.ch/geant4-data/datasets/G4EMLOW.7.7.tar.gz \
     https://cern.ch/geant4-data/datasets/G4PhotonEvaporation.5.3.tar.gz \
     https://cern.ch/geant4-data/datasets/G4RadioactiveDecay.5.3.tar.gz \
     https://cern.ch/geant4-data/datasets/G4PARTICLEXS.1.1.tar.gz \
     https://cern.ch/geant4-data/datasets/G4PII.1.3.tar.gz \
     https://cern.ch/geant4-data/datasets/G4RealSurface.2.1.1.tar.gz \
     https://cern.ch/geant4-data/datasets/G4SAIDDATA.2.0.tar.gz \
     https://cern.ch/geant4-data/datasets/G4ABLA.3.1.tar.gz \
     https://cern.ch/geant4-data/datasets/G4INCL.1.0.tar.gz \
     https://cern.ch/geant4-data/datasets/G4ENSDFSTATE.2.2.tar.gz

About

Simplified Geant4 usage with a docker container derived from a Ubuntu 18.04 ROOT container

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published