# Can't run model in Docker container

**URL:** https://openmc.discourse.group/t/cant-run-model-in-docker-container/2152
**Category:** User Support
**Created:** [June 29, 2022, 9:03am UTC](https://openmc.discourse.group/t/cant-run-model-in-docker-container/2152 "2022-06-29T09:03:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Rem](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@Rem](https://openmc.discourse.group/u/Rem)
#### Post date: [June 29, 2022, 9:03am UTC](https://openmc.discourse.group/t/cant-run-model-in-docker-container/2152/1 "2022-06-29T09:03:23Z")

</div>

Hi all,

When running the following MWE in a container from `openmc/openmc:latest`, I get the following error:

MWE.py

```python
import openmc

mat = openmc.Material()
mat.add_nuclide('Zr90', 1.0)
mat.set_density('g/cm3', 1.0)

model = openmc.Model()
sph = openmc.Sphere(r=25.0, boundary_type='vacuum')
cell = openmc.Cell(fill=mat, region=-sph)
model.geometry = openmc.Geometry([cell])

model.settings.run_mode = 'fixed source'
model.settings.batches = 2
model.settings.particles = 50

model.run()

```

To reproduce:

```auto
docker run -ti openmc/openmc
cd home
git clone https://github.com/openmc-dev/openmc
cd openmc
pip install -e .
python MWE.py

```

I get the following error:

```auto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/openmc/openmc/model/model.py", line 553, in run
    if self.is_initialized:
  File "/home/openmc/openmc/model/model.py", line 115, in is_initialized
    import openmc.lib
  File "/home/openmc/openmc/lib/ __init__.py", line 32, in <module>
    _dll = CDLL(_filename)
  File "/usr/lib/python3.9/ctypes/ __init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/openmc/openmc/lib/libopenmc.so: cannot open shared object file: No such file or directory

```

Is something broken with the openmc docker images?  
I’m also surprised I have to clone openmc

---

<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: [June 29, 2022, 10:06am UTC](https://openmc.discourse.group/t/cant-run-model-in-docker-container/2152/2 "2022-06-29T10:06:51Z")

</div>

Hi Remi, great to see you on here

For some reason the last docker image release didn’t install the python openmc api correctly. This was reported and solved (for the next docker release) in this github issue [Openmc docker image missing openmc · Issue #1973 · openmc-dev/openmc (github.com)](https://github.com/openmc-dev/openmc/issues/1973)

I would try running the docker image but cd into the existing openmc dir and pip install from there

```auto
docker run -ti openmc/openmc
cd /opt/openmc
pip install -e .

```

---

<div class="post-metadata">

### Author: ![Rem](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@Rem](https://openmc.discourse.group/u/Rem)
#### Post date: [June 29, 2022, 10:54am UTC](https://openmc.discourse.group/t/cant-run-model-in-docker-container/2152/3 "2022-06-29T10:54:46Z")

</div>

Ok I shall try this.

Any idea how I could use this in development from a fork of the openmc repo?

---

<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: [June 29, 2022, 11:01am UTC](https://openmc.discourse.group/t/cant-run-model-in-docker-container/2152/4 "2022-06-29T11:01:44Z")

</div>

In that case I would use the Docker image I have in a [PR](https://github.com/openmc-dev/openmc/pull/2097) built with a target of dependencies, then run and mount the local openmc repo and work from that.

However using the existing dockerimage you could change the remote url

```auto
git remote set-url <remote_name> <remote_url>

```

Another option is to use GitHub Codespaces which would allow you to launch a dev environment in the browser in the manner you require.
