Skip to content

ischoegl/cantera-docker

Repository files navigation

cantera-docker

Container compiles cantera from source (using separate layers for tool chain, source compilation and testing).

The workflow was tested on a Docker CE installation.

Usage

Build docker image with tool chain (ubuntu + buildessentials, etc.).

$ cd ubuntu-toolchain
$ docker build -t ubuntu-toolchain .
$ cd ..

Build docker image that compiles cantera from source (i.e. this will take a while).

$ cd cantera-src
$ docker build -t cantera-src .
$ cd ..

Build third layer for testing (avoiding container with root privileges)

$ cd cantera-testing
$ docker build -t cantera-testing .
$ cd ..

Initialize the container

$ docker run -it cantera-testing

Verify that everything works

ctuser@<container_ID>:~$ cp .python-examples/surface_chemistry/catalytic_combustion.py .
ctuser@<container_ID>:~$ python catalytic_combustion.py

Enabling GUI Display

TODO: this no longer works

A quick example for a running GUI, based on this

$ cd gui
$ docker build -t gui-app .

On Wayland, additional measures are required allow local user access to to x host, and retrieve the user id

$ xhost +SI:localuser:$(id -un)
$ id -u

Then start a container using:

$ docker run --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" \
             --user=$(id -u):$(id -g) gui-app

Share a Local Folder with Docker

Start docker container, using a bind mount to the local folder

$ docker run -it --name <container_name> --mount type=bind,source="$(pwd)",target=/<folder> <image_name>

Alternatives

References

About

Docker container with cantera compiled from source

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages