Skip to content
Snippets Groups Projects
Commit ff05f401 authored by Lars Bilke's avatar Lars Bilke
Browse files

[web] Container and Windows notes.

parent 47c9644b
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ weight = 1035 ...@@ -15,7 +15,7 @@ weight = 1035
> >
> <cite>[www.docker.com/whatisdocker](https://www.docker.com/whatisdocker)</cite> > <cite>[www.docker.com/whatisdocker](https://www.docker.com/whatisdocker)</cite>
See the [docs](https://docs.docker.com) for installation instructions. See the [docs](https://docs.docker.com) for installation instructions (if you are on Windows we highly recommend the [Docker Desktop WSL 2 backend](https://docs.docker.com/docker-for-windows/wsl/)).
## Images ## Images
...@@ -24,7 +24,7 @@ Docker images can be created by [Dockerfiles](https://docs.docker.com/reference/ ...@@ -24,7 +24,7 @@ Docker images can be created by [Dockerfiles](https://docs.docker.com/reference/
To build an image by yourself create a Dockerfile: To build an image by yourself create a Dockerfile:
```bash ```bash
FROM ubuntu:17.10 FROM ubuntu:20.04
RUN ... RUN ...
``` ```
...@@ -32,10 +32,9 @@ RUN ... ...@@ -32,10 +32,9 @@ RUN ...
Run the `build` command: Run the `build` command:
```bash ```bash
docker build --rm -t repo/image_name path/to/directory docker build -t repo/image_name path/to/directory
``` ```
- `--rm` Cleans up after exiting the container
- `-t` specifies a name for the image, can be arbitrary chosen (but should match the corresponding image on Docker Hub if there is one) - `-t` specifies a name for the image, can be arbitrary chosen (but should match the corresponding image on Docker Hub if there is one)
- The path should specify the directory where the Dockerfile is located - The path should specify the directory where the Dockerfile is located
...@@ -46,19 +45,21 @@ Now you can see your build image with `$ docker images`. ...@@ -46,19 +45,21 @@ Now you can see your build image with `$ docker images`.
To run commands inside a container: To run commands inside a container:
```bash ```bash
docker run --rm -t image_name command_to_run docker run --rm image_name command_to_run
``` ```
To run an interactive shell add the `-i`-switch: - `--rm` Cleans up after exiting the container
To run an interactive shell add the `-it`-switch:
```bash ```bash
docker run --rm -i -t image_name docker run --rm -it image_name
``` ```
It is useful to mount folders from the host operating system in the Docker container, e.g. to edit source code on your host with your favorite editor: It is useful to mount folders from the host operating system in the Docker container, e.g. to edit source code on your host with your favorite editor:
```bash ```bash
docker run --rm -i -t -v /host/directory:/container/directory image_name docker run --rm -it -v /host/directory:/container/directory image_name
``` ```
## Prebuilt OGS-6 Docker images ## Prebuilt OGS-6 Docker images
......
...@@ -23,7 +23,7 @@ Singularity per default mounts your home directory and also passes your current ...@@ -23,7 +23,7 @@ Singularity per default mounts your home directory and also passes your current
### Prerequisites ### Prerequisites
- Linux and [Mac](https://sylabs.io/singularity-desktop-macos/) only! - Linux and [Mac](https://sylabs.io/singularity-desktop-macos/) only!
- Note: You can run Singularity on Windows inside a virtual machine using [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/install-win10) - Note: You can run Singularity **on Windows** inside a lightweight virtual machine using [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/install-win10). Under Ubuntu use Homebrew package `singularity`, under CentOS install via [EPEL](https://sylabs.io/guides/3.0/user-guide/installation.html#install-the-centos-rhel-package-using-yum).
- [Install Git]({{< ref "prerequisites" >}}/#step-install-git) - [Install Git]({{< ref "prerequisites" >}}/#step-install-git)
- [Install Singularity](https://sylabs.io/guides/3.5/user-guide/quick_start.html#quick-installation-steps) - [Install Singularity](https://sylabs.io/guides/3.5/user-guide/quick_start.html#quick-installation-steps)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment