Docker

Introduction

Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.

See the docs for installation instructions.

Images

Docker images can be created by Dockerfiles which can be stacked and thus form a directed graph. OGS-6 image definitions can be found at the ufz/dockerfiles-repo. Built images can be found at Docker Hub.

To build an image by yourself create a Dockerfile:

FROM ubuntu:14.04
MAINTAINER Jon Doe <jon.doe@foo.com>

RUN ...

Run the build command:

  • -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

Now you can see your build image with $ docker images.

Run a container

To run commands inside a container:

To run an interactive shell add the -i-switch:

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:

Prebuilt OGS-6 Docker images

There are docker images provided on Docker Hub which include everything necessary to build OGS-6.

There are images for gcc, clang and mingw. For every compiler there is one basic image with the compiler ready (-dev-essentials), one image with all dependencies for the OGS simulator (-base) and maybe an image for Data Explorer development (-gui).

E.g. to start developing OGS:

You are now in the Docker container the ogs source code from your host computer mounted at /usr/src/ogs. Now you can build and run OGS:

This article was written by Lars Bilke. If you are missing something or you find an error please let us know. Generated with Hugo 0.42.1. Last revision: February 26, 2018
Commit: [web] Finished advanced section in devguide. a50886a67  | Edit this page on


Creative Commons License | Privacy policy / Legal statements / Impressum