Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Contents:

Table of Contents
 

...

Creation of a docker build directory

The first step is to make a directory from which the OpenIFS container can be created and cd into that directory, e.g.

...

This cp step is important because the Dockerfile  and the OpenIFS release, i.e., openifs-48r1.1, need to be in the same directory to build the container (see the openifs-48r1.1/scripts/docker/gcc-docker-48r1.1/Dockerfile)

Build the OpenIFS docker image

The following command builds the docker image

...

Note
  • At the time of writing open-mpi is downloaded and built as part of the image creation. This is quite slow, so in the future we will investigate the use of a standard library
  • If a fresh build is required but an image has already been built, then execute the following command, which is the same as above but with no-cache
Code Block
languagebash
themeMidnight
docker build --no-cache --tag "openifs-48r1.1" .
  • The tag name does not need to be provided but it is useful for identifying images.

Running OpenIFS-test using the docker image

Once a build has completed, the image can be checked by typing docker images , e.g.,

...

On a Macbook pro (M1) the build of OpenIFS, takes about 10 minutes, while successful completion of ifstest takes just over 3 minutes.

Basic docker commands and functionality

Check for existing containers

From a terminal on the host system, it is possible to list running and exited containers with the following

  1. List running containers

    Code Block
    languagebash
    themeMidnight
    $ docker ps
    
    CONTAINER ID   IMAGE            COMMAND   CREATED        STATUS         PORTS     NAMES
    d1bd89ccc47f   openifs-48r1.1   "bash"    15 hours ago   Up 5 seconds             beautiful_pasteur

     If no container is running on your system, then only CAPITAL headings are returned with docker ps 

  2. List all containers (running and exited)

    Code Block
    languagebash
    themeMidnight
    $ docker ps -a
    
    CONTAINER ID   IMAGE               COMMAND       CREATED        STATUS                     PORTS     NAMES
    d1bd89ccc47f   openifs-48r1.1      "bash"        15 hours ago   Exited (0) 4 seconds ago             beautiful_pasteur

    Notice that the STATUS  is Exited, rather than Up, as in (1)

Start an existing container

If docker ps -a shows an exited container it can be restarted using the following

Code Block
languagebash
themeMidnight
$ docker start -i <Container ID> 
# e.g. 
$ docker ps -a

CONTAINER ID   IMAGE               COMMAND       CREATED        STATUS                     PORTS     NAMES
d1bd89ccc47f   openifs-48r1.1      "bash"        15 hours ago   Exited (0) 4 seconds ago             beautiful_pasteur

$ docker start -i  d1bd89ccc47f

Exiting the container

  1. The container can be exited by typing exit from the active container.
  2. A container can be stopped from a terminal on the host system

    Code Block
    languagebash
    themeMidnight
    docker stop <Container ID>

    It is also possible to stop multiple containers at once by adding more than one ID.

  3. Using docker stop  will attempt a clean shutdown. It is also possible to stop the container by killing it 

    Code Block
    languagebash
    themeMidnight
    docker kill <Container ID>


Removing containers and images

Remove a container with the following command

...