README.md 2 KB
Newer Older
Timo Koch's avatar
Timo Koch committed
1
2
3
4
5
6
7
Using DuMux in a Docker container
==================================

This repository contains the Dockerfiles to build Docker images. The Docker
images can be found on the [Dumux Docker Hub](https://hub.docker.com/u/dumux/).
Using these Docker images you can spin up Docker containers to run DuMux.

Timo Koch's avatar
Timo Koch committed
8
9
10
11
12
13
14
15
16
17
18
19

Running a DuMux Docker container
---------------------------------

You also can spin up a Docker container running DuMux by simly using the Docker command. However,
the expression can get quite lengthy, especially when you want to support the graphical display.

Run
```bash
docker run -it --rm --env DISPLAY=unix$DISPLAY --device /dev/dri --volume /tmp/.X11-unix:/tmp/.X11-unix:rw dumux:latest /bin/bash
```

Timo Koch's avatar
Timo Koch committed
20
Running with docker-compose
Timo Koch's avatar
Timo Koch committed
21
-------------------------------
Timo Koch's avatar
Timo Koch committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

The easiest is starting the container using docker-compose.
Create a YAML file called `docker-compose.yml` (default recognized by docker-compose) or choosing
a custom name with the following content.

```yaml
# Starts a dumux container with graphic support
dumux:
  image: dumux:latest
  container_name: 'dumux'
  volumes:
    - /tmp/.X11-unix:/tmp/.X11-unix:rw
  devices:
    - /dev/dri
  environment:
    - DISPLAY=unix$DISPLAY
  entrypoint:
    - /bin/bash
  stdin_open: true
  tty: true
```

Then run

```bash
docker-compose [-f mydockercomposefile.yml] run dumux
```
This will start a Docker container running DuMux (hopefully with graphical support).
Docker-compose will default to `docker-compose.yml` if no file is specified with the `-f` option.


Timo Koch's avatar
Timo Koch committed
53
54
Run first DuMux program in Docker container
---------------------------------------------
Timo Koch's avatar
Timo Koch committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

To run your first DuMux application change the directory by running
```bash
cd dumux/build-cmake/test/porousmediumflow/1p/implicit
```
build the program running
```bash
make test_cc1p
```
and run it
```bash
./test_cc1p
```

Congratulations you just solved a one-phase model in a quadratic domain with permeability lens.
You can have a look at the result with the visualization tool paraview.

```bash
paraview 1ptestcc.pvd
```