Official docker image for DeepFlame
304
A ready-to-run CPU image with compiled DeepFlame solvers, source code, examples, and build tools. Supports Cantera/CVODE and CPU PyTorch on Linux amd64. Vim is included for offline editing.
Run these commands in a Linux terminal. On Windows, use a WSL terminal.
docker pull deepflamecfd/deepflame-dev:2.0
mkdir -p "$HOME/deepflame-data"
docker run --shm-size=2g -itd \
--name deepflame-cpu \
--mount "type=bind,source=${HOME}/deepflame-data,target=/workspace" \
deepflamecfd/deepflame-dev:2.0 /bin/bash
docker exec -it deepflame-cpu bash
--shm-size=2g provides 2 GB of shared memory for models such as FGM.--name deepflame-cpu gives the container a fixed name.--mount maps the host directory $HOME/deepflame-data to /workspace. Files written there remain available on the host.-itd keeps the container running in the background.Choose another host directory or container name as needed. Run docker run once to create the container. Use exit to leave the shell, and docker exec -it deepflame-cpu bash to enter it again.
To stop and restart the container:
docker stop deepflame-cpu
docker start deepflame-cpu
docker exec -it deepflame-cpu bash
Inside the container, copy and run the hydrogen zero-dimensional reactor example:
cp -rL /opt/deepflame-dev/examples/df0DFoam/zeroD_cubicReactor/H2/cvodeIntegrator /workspace/h2
cd /workspace/h2
bash ./Allrun
The example uses CVODE and four MPI processes. Results are saved in $HOME/deepflame-data/h2 on the host when using the mount above.
The image includes Ubuntu 20.04, OpenFOAM-7, Cantera 2.6, Python 3.8, PyTorch 2.2.2 (CPU), OpenMPI, compilers, and Vim.
/root/.bashrc automatically loads these environments when an interactive Bash shell starts:
source /opt/openfoam7/etc/bashrc
source /opt/deepflame-dev/bashrc
The first script sets up OpenFOAM tools, libraries, and MPI. The second adds DeepFlame solvers and libraries, Cantera paths, and the Python interface configuration. Python and Cantera are installed in /opt/deepflame, whose bin directory is already on PATH; CONDA_PREFIX is set to /opt/deepflame.
The container entrypoint also loads OpenFOAM and DeepFlame for commands passed to docker run.
| Content | Path |
|---|---|
| DeepFlame source, solvers, and examples | /opt/deepflame-dev |
| OpenFOAM-7 | /opt/openfoam7 |
| Python, Cantera, and PyTorch | /opt/deepflame |
| Package versions and source commit | /opt/deepflame-manifest |
| Mounted case directory | /workspace |
Version tags follow DeepFlame releases: 2.0 corresponds to v2.0.0, and 2.0.1 corresponds to v2.0.1. latest points to the latest stable release that has passed validation.
From the root of the Dockerfiles repository, run:
python3 build.py cpu --tag deepflame-cpu:2.0
Requires Python 3.8+. The default source version is v2.0.0; use --ref to change it and --jobs 4 to set compilation parallelism. --mirror auto (default) selects Ubuntu, PyPI and conda-forge sources by download speed. Use --mirror china to prefer Tsinghua/USTC mirrors with official fallback, or --mirror official for official sources. Logs are saved in .build/.
To build directly with official sources:
docker build --platform linux/amd64 -f cpu/Dockerfile -t deepflame-cpu:2.0 .
See the DeepFlame documentation for models and examples.
Content type
Image
Digest
sha256:edc121c22…
Size
1 GB
Last updated
9 days ago
docker pull deepflamecfd/deepflame-dev