This starts the container, mounts your home directory inside the container, passes the current working directory and runs the ogs executable (in your home directory which is mounted inside the container) with the passed project file. Everything works as expected and is transparent to the user. When ogs finishes the container stops and returns to the host system.
The `--app ogs` selects a predefined execution environment in the container (i.e. setting the `PATH` to `/scif/apps/ogs/bin` in which all the executables are located). You could also (and **on macOS you have to**) run without the `--app`-parameter but then you had to specify the full executable path in the container:
You can also specify the full executable path in the container:
You can interactively explore the container with `singularity shell` (you can see that you are **in** the container because of the `Singularity [container image file]:...>` prefix of the shell):
```bash
# Shell into container
singularity shell ogs-6.2.2-serial.sif
singularity shell ogs-6.x.x-serial.sif
# List files in the container
Singularity ogs-6.2.2-serial.sif:...> ls /scif/apps/ogs/bin
Singularity ogs-6.x.x-serial.sif:...> ls /scif/apps/ogs/bin
... ogs tetgen vtkdiff
# Exit the container and get back to your hosts shell
Singularity ogs-6.2.2-serial.sif:...> exit
Singularity ogs-6.x.x-serial.sif:...> exit
```
### Custom Python environment for the container
...
...
@@ -100,13 +100,13 @@ exit
# Now outside the container
# The virtualenv-directory .venv still persists
# If you want to run something in the container with exec, source the venv before:
You may use this container on e.g. `envinf1` with X11 forwarding (`ssh -XY envinf1`).
...
...
@@ -124,15 +124,15 @@ Although Singularity is the preferred container runtime you can use [Docker](htt
* Get the container: `docker pull registry.opengeosys.org/ogs/ogs/ogs-serial`
* Start interactive container session: `docker run --rm -it registry.opengeosys.org/ogs/ogs/ogs-serial`
* Run ogs: `/scif/apps/ogs/bin/ogs --version`
* Run ogs: `/usr/local/ogs/bin/ogs --version`
* Exit the container: `exit`
You will notice that the interactive session in your container is isolated from your host, i.e. you do not have access to files on your host. You need to explicitly [mount](https://docs.docker.com/storage/bind-mounts/) them on `docker run`:
```bash
mkdir ~/ogs_out
docker run --rm-it-v$HOME/code/ogs6/ogs/Tests/Data:/tmp/data:ro -v$HOME/ogs_out:/tmp/out registry.opengeosys.org/ogs/ogs/ogs-seria