# Docker configuration

**URL:** https://openmc.discourse.group/t/docker-configuration/1911
**Category:** User Support
**Created:** [April 8, 2022, 8:38am UTC](https://openmc.discourse.group/t/docker-configuration/1911 "2022-04-08T08:38:20Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![lorenzoloi](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@lorenzoloi](https://openmc.discourse.group/u/lorenzoloi)
#### Post date: [April 8, 2022, 8:38am UTC](https://openmc.discourse.group/t/docker-configuration/1911/1 "2022-04-08T08:38:20Z")

</div>

Hello,  
I am a Windows user and I a trying to figure out how to work with OpenMC.  
I followed the Docker way since it seems the simpler one, so following the intructions in the User’s guide I successfully downloaded it and the execution of the command in the powershell:

```auto
docker run openmc/openmc:latest

```

went well.

Then, looking at both the forum as well as the Developer’s guide Sec.7, I was stucked at the first line:

```auto
docker build -t debian/openmc:latest https://github.com/openmc-dev/openmc.git#develop

```

since the procedure stops and gives me an error:

```auto
PS C:\Users\loren> docker build -t debian/openmc:latest https://github.com/openmc-dev/openmc.git#develop
[+] Building 24.4s (10/11)
 => CACHED [internal] load git source https://github.com/openmc-dev/openmc.git#develop 0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye-slim 1.8s
 => [auth] library/debian:pull token for registry-1.docker.io 0.0s
 => [1/8] FROM docker.io/library/debian:bullseye-slim@sha256:78fd65998de7a59a001d792fe2d3a6d2ea25b6f3f068e5c84881250373577414 0.0s
 => CACHED [2/8] RUN apt-get update -y && apt-get upgrade -y && apt-get install -y python3-pip python-is-python3 wget git build-essential cmake mpich libmpich 0.0s
 => CACHED [3/8] RUN pip install --upgrade pip 0.0s
 => CACHED [4/8] RUN cd /root && git clone --single-branch --depth 1 https://github.com/njoy/NJOY2016 && cd NJOY2016 && mkdir build && cd build && cmake -Dstatic= 0.0s
 => CACHED [5/8] RUN if ["off" = "on"]; then apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev && pip install --upgrade numpy cython && 0.0s
 => CACHED [6/8] RUN if ["off" = "on"]; then apt-get -y install m4 libnetcdf-dev libpnetcdf-dev && mkdir -p /root/LIBMESH && cd /root/LIBMESH && git clone - 0.0s
 => ERROR [7/8] RUN mkdir -p /root/OpenMC && cd /root/OpenMC && git clone --shallow-submodules --recurse-submodules --single-branch -b master --depth=1 https://github.com/openmc 22.5s
------
 > [7/8] RUN mkdir -p /root/OpenMC && cd /root/OpenMC && git clone --shallow-submodules --recurse-submodules --single-branch -b master --depth=1 https://github.com/openmc-dev/openmc && mkdir build && cd build ; if [off = "on"] && [off = "on"]; then cmake ../openmc -DOPENMC_USE_MPI=on -DHDF5_PREFER_PARALLEL=on -DOPENMC_USE_DAGMC=on -DOPENMC_USE_LIBMESH=on -DCMAKE_PREFIX_PATH="/root/DAGMC/;/root/LIBMESH" ; fi ; if [off = "on"] && [off = "off"]; then cmake ../openmc -DOPENMC_USE_MPI=on -DHDF5_PREFER_PARALLEL=on -DOPENMC_USE_DAGMC=ON -DCMAKE_PREFIX_PATH=/root/DAGMC/ ; fi ; if [off = "off"] && [off = "on"]; then cmake ../openmc -DOPENMC_USE_MPI=on -DHDF5_PREFER_PARALLEL=on -DOPENMC_USE_LIBMESH=on -DCMAKE_PREFIX_PATH=/root/LIBMESH ; fi ; if [off = "off"] && [off = "off"]; then cmake ../openmc -DOPENMC_USE_MPI=on -DHDF5_PREFER_PARALLEL=on ; fi ; make 2>/dev/null -j1 install && cd ../openmc && pip install .[test,depletion-mpi] && python -c "import openmc":
#10 0.623 Cloning into 'openmc'...
#10 4.669 Submodule 'vendor/fmt' (https://github.com/fmtlib/fmt.git) registered for path 'vendor/fmt'
#10 4.670 Submodule 'vendor/gsl-lite' (https://github.com/martinmoene/gsl-lite.git) registered for path 'vendor/gsl-lite'
#10 4.672 Submodule 'vendor/pugixml' (https://github.com/zeux/pugixml.git) registered for path 'vendor/pugixml'
#10 4.673 Submodule 'vendor/xtensor' (https://github.com/xtensor-stack/xtensor.git) registered for path 'vendor/xtensor'
#10 4.674 Submodule 'vendor/xtl' (https://github.com/xtensor-stack/xtl.git) registered for path 'vendor/xtl'
#10 4.682 Cloning into '/root/OpenMC/openmc/vendor/fmt'...
#10 6.030 Cloning into '/root/OpenMC/openmc/vendor/gsl-lite'...
#10 6.973 Cloning into '/root/OpenMC/openmc/vendor/pugixml'...
#10 8.273 Cloning into '/root/OpenMC/openmc/vendor/xtensor'...
#10 10.05 Cloning into '/root/OpenMC/openmc/vendor/xtl'...
#10 13.05 From https://github.com/fmtlib/fmt
#10 13.05 * branch d141cdbeb0fb422a3fb7173b285fd38e0d1772dc -> FETCH_HEAD
#10 13.15 Submodule path 'vendor/fmt': checked out 'd141cdbeb0fb422a3fb7173b285fd38e0d1772dc'
#10 14.95 From https://github.com/martinmoene/gsl-lite
#10 14.95 * branch 913e86d49c6a1acca980f4e325378f9dc393493a -> FETCH_HEAD
#10 15.00 Submodule path 'vendor/gsl-lite': checked out '913e86d49c6a1acca980f4e325378f9dc393493a'
#10 16.78 From https://github.com/zeux/pugixml
#10 16.78 * branch 41b6ff21c455865bb8ef67c5952b7f895b62bacc -> FETCH_HEAD
#10 16.83 Submodule path 'vendor/pugixml': checked out '41b6ff21c455865bb8ef67c5952b7f895b62bacc'
#10 19.06 From https://github.com/xtensor-stack/xtensor
#10 19.06 * branch 31acec1e90bbea6d4bc17af0710a123bd5da6689 -> FETCH_HEAD
#10 19.15 Submodule path 'vendor/xtensor': checked out '31acec1e90bbea6d4bc17af0710a123bd5da6689'
#10 20.97 From https://github.com/xtensor-stack/xtl
#10 20.97 * branch c19750fb1488369dc41f6069bc2b8446fc093e75 -> FETCH_HEAD
#10 21.00 Submodule path 'vendor/xtl': checked out 'c19750fb1488369dc41f6069bc2b8446fc093e75'
#10 21.13 -- The C compiler identification is GNU 10.2.1
#10 21.26 -- The CXX compiler identification is GNU 10.2.1
#10 21.27 -- Detecting C compiler ABI info
#10 21.40 -- Detecting C compiler ABI info - done
#10 21.44 -- Check for working C compiler: /usr/bin/cc - skipped
#10 21.44 -- Detecting C compile features
#10 21.44 -- Detecting C compile features - done
#10 21.45 -- Detecting CXX compiler ABI info
#10 21.64 -- Detecting CXX compiler ABI info - done
#10 21.66 -- Check for working CXX compiler: /usr/bin/c++ - skipped
#10 21.66 -- Detecting CXX compile features
#10 21.66 -- Detecting CXX compile features - done
#10 21.67 -- Did not find fmt, will use submodule instead
#10 21.67 -- Did not find pugixml, will use submodule instead
#10 21.68 -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
#10 21.69 -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.37")
#10 22.19 -- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/mpich/libhdf5.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.10.6") found components: C HL
#10 22.19 CMake Error at CMakeLists.txt:107 (message):
#10 22.19 Parallel HDF5 was detected, but the detected compiler, /usr/bin/c++, does
#10 22.19 not support MPI. An MPI-capable compiler must be used with parallel HDF5.
#10 22.19
#10 22.19
#10 22.19 -- Configuring incomplete, errors occurred!
#10 22.19 See also "/root/OpenMC/build/CMakeFiles/CMakeOutput.log".
------
executor failed running [/bin/sh -c mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC && git clone --shallow-submodules --recurse-submodules --single-branch -b ${openmc_branch} --depth=1 ${OPENMC_REPO} && mkdir build && cd build ; if [${build_dagmc} = "on"] && [${build_libmesh} = "on"]; then cmake ../openmc -DOPENMC_USE_MPI=on -DHDF5_PREFER_PARALLEL=on -DOPENMC_USE_DAGMC=on -DOPENMC_USE_LIBMESH=on -DCMAKE_PREFIX_PATH="${DAGMC_INSTALL_DIR};${LIBMESH_INSTALL_DIR}" ; fi ; if [${build_dagmc} = "on"] && [${build_libmesh} = "off"]; then cmake ../openmc -DOPENMC_USE_MPI=on -DHDF5_PREFER_PARALLEL=on -DOPENMC_USE_DAGMC=ON -DCMAKE_PREFIX_PATH=${DAGMC_INSTALL_DIR} ; fi ; if [${build_dagmc} = "off"] && [${build_libmesh} = "on"]; then cmake ../openmc -DOPENMC_USE_MPI=on -DHDF5_PREFER_PARALLEL=on -DOPENMC_USE_LIBMESH=on -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR} ; fi ; if [${build_dagmc} = "off"] && [${build_libmesh} = "off"]; then cmake ../openmc -DOPENMC_USE_MPI=on -DHDF5_PREFER_PARALLEL=on ; fi ; make 2>/dev/null -j${compile_cores} install && cd ../openmc && pip install .[test,depletion-mpi] && python -c "import openmc"]: exit code: 2

```

I apologize for the long error’s _wall of text_.

Am I doing it wrong/skipping some passage?  
Do you have any suggestion to complete the image creation?  
Do you think that using a virtual machine and downloading openMC from source will be easier?

Thank you very much for helping.

Sincerely,  
Lorenzo

---

<div class="post-metadata">

### Author: ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)
#### Post date: [April 13, 2022, 5:22am UTC](https://openmc.discourse.group/t/docker-configuration/1911/2 "2022-04-13T05:22:00Z")

</div>

Welcome to the forum @lorenzoloi

`docker run` command will download the image first if it’s not found locally. After that, to run a container, the only thing you need to include in the command is the image on which it is based.

```bash
docker run openmc/openmc:latest

```

---

<div class="post-metadata">

### Author: ![lorenzoloi](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@lorenzoloi](https://openmc.discourse.group/u/lorenzoloi)
#### Post date: [May 24, 2022, 3:01pm UTC](https://openmc.discourse.group/t/docker-configuration/1911/3 "2022-05-24T15:01:39Z")

</div>

Thanks for the reply and sorry for the delay @Pranto.

I’ve still some problems in working with OpenMC.

Once i’ve pasted in the powershell the command:

```auto
docker run openmc/openmc:latest

```

the image is correctly downloaded.  
Then, i paste the following in order to go inside the interactive container called _my\_openmc_:

```auto
docker run -it --name=my_openmc openmc/openmc:latest

```

at this point, according to other posts in this forum and also to the docker official documentation regarding openmc at: [openmc/openmc - Docker Image | Docker Hub](https://hub.docker.com/r/openmc/openmc), I should be inside an environment with installed OpenMC in the /opt folder.

However, this folder is empy.  
I also tried to copy one of the pincell examples /root/OpenMC/openmc/examples/pincell inside a directory but it gives me the same error which is:

> python build\_xml.py  
> Traceback (most recent call last):  
> File “/opt/prova/build\_xml.py”, line 4, in   
> import openmc  
> ModuleNotFoundError: No module named ‘openmc’

Am I doing it wrong something?

Thank you very much and sorry to bother.

---

<div class="post-metadata">

### Author: ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)
#### Post date: [May 30, 2022, 8:45am UTC](https://openmc.discourse.group/t/docker-configuration/1911/4 "2022-05-30T08:45:09Z")

</div>

Unfortunately the last docker image release didn’t run the `pip install .` command correctly to install the python api for openmc.

We aim to release another docker image that will replace the `latest` image and we have fixed [the issue](https://github.com/openmc-dev/openmc/issues/1973) in the develop branch with [this](https://github.com/openmc-dev/openmc/pull/1977) PR

In the meantime you could build the docker image which takes a bit longer but should work

```auto
git clone https://github.com/openmc-dev/openmc.git
cd openmc
docker build -t my_openmc .

```

Sorry for this inconvenience, let us know if this works for you

---

<div class="post-metadata">

### Author: ![lorenzoloi](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@lorenzoloi](https://openmc.discourse.group/u/lorenzoloi)
#### Post date: [June 10, 2022, 9:15am UTC](https://openmc.discourse.group/t/docker-configuration/1911/5 "2022-06-10T09:15:58Z")

</div>

Hello @Shimwell,  
I successfully cloned openmc from git in my personal laptop. Unfortunately, the last command

`docker build -t my_openmc .`

face an error during the configuration with an exit code=2.

I think that I will wait the release of the replacement to the `latest` image, which seems to me the easier way.

Can I ask you how may I know when it will be released?  
Thank you very much

---

<div class="post-metadata">

### Author: ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)
#### Post date: [June 11, 2022, 3:38am UTC](https://openmc.discourse.group/t/docker-configuration/1911/6 "2022-06-11T03:38:54Z")

</div>

@lorenzoloi I’m hoping to get a release out within the next month.

---

<div class="post-metadata">

### Author: ![lorenzoloi](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@lorenzoloi](https://openmc.discourse.group/u/lorenzoloi)
#### Post date: [July 7, 2022, 9:26am UTC](https://openmc.discourse.group/t/docker-configuration/1911/7 "2022-07-07T09:26:27Z")

</div>

Hello @paulromano, sorry to bother.  
Is there any news on the `latest` release? On the Docker website [Docker Hub](https://hub.docker.com/r/openmc/openmc) is reported that it has been updated 20h ago but the configuration still does not work (\opt folder empty in the container).

Thank you

---

<div class="post-metadata">

### Author: ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)
#### Post date: [August 3, 2022, 3:48am UTC](https://openmc.discourse.group/t/docker-configuration/1911/8 "2022-08-03T03:48:13Z")

</div>

Hi @lorenzoloi. Sorry I missed this message before. We’re now in the final stages of putting a release together. You can track progress on the corresponding GitHub [milestone](https://github.com/openmc-dev/openmc/milestone/22).

As far as the Docker issue you encountered, there was a [fix](https://github.com/openmc-dev/openmc/pull/2124) for the Dockerfile that was merged in OpenMC recently. You could try using the `develop` tag instead of `latest`.
