Skip to content

Commit 71d623a

Browse files
committed
Add a document about how to run docker
1 parent 165e647 commit 71d623a

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

docs/_toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ root: index
44
chapters:
55
- file: abstract
66
- file: reproducing
7+
- file: docker
78
- file: demo
89
- file: citation

docs/docker.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Running in Docker
2+
3+
We have created a docker image containing all the dependencies as well as the source code in the repository. To get the most recent version of the docker image, make sure to pull the latest image first
4+
```bash
5+
docker pull ghcr.io/scientificcomputing/example-paper-fenics:latest
6+
```
7+
8+
Now you can start a docker container using the command
9+
```bash
10+
docker run --rm -it ghcr.io/scientificcomputing/example-paper-fenics
11+
```
12+
This will bring you into the default working directory at `/repo` where you will find the folder `example-paper-fenics` containing the source code from the repository.
13+
14+
From here you can follow the steps outlined in [](reproducing-main) to reproduce the results.
15+
16+
## Sharing the results in the container with your local machine
17+
You might want to move the results the you create in the container to your local machine. To do this you need to mount a volume from local machine into the container. For example, you can mount the current directory (which is stored in the environment variable $PWD) into the folder `/repo/local` by running the container using the following command
18+
```bash
19+
docker run --rm -v $PWD:/repo/local -it ghcr.io/scientificcomputing/example-paper-fenics
20+
```
21+
When entering the container now you should now see both the folder `example-paper-fenics` and a folder called `local`. Once you have generated some results inside `example-paper-fenics` you can copy these results over to the folder called `local` and they should appear in the current directory on you local machine. For example, you could try to copy the readme file
22+
```bash
23+
cp /repo/example-paper-fenics/README.md /repo/local/.
24+
```
25+
and you should now see the readme file appearing on your machine.

docs/reproducing.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
(reproducing-main)=
12
# Reproducing
23

3-
44
## Data
55

6-
Data is available in a dropbox folder. Use the script `download_data.sh` in the data folder to download the data.
6+
Data is available in a dropbox folder. Use the script `download_data.sh` in the data folder to download the data, i.e
7+
```bash
8+
cd data
9+
bash download_data.sh
10+
```
711

812
The data folder should have the following structure after the data is downloaded.
913
```

0 commit comments

Comments
 (0)