Using Docker for Compute Nodes#

The ICE ClusterWare ™ platform supports Docker, which is available from CentOS.

The following example shows Docker being used to execute the pre-built Docker "Hello World" image.

  1. Create a new image by cloning an existing image:

    cw-imgctl -i DefaultImage clone name=DockerImage
    
  2. Install the necessary packages inside the new image:

    cw-modimg -i DockerImage --freshen --overwrite --no-discard \
             --install docker --exec "systemctl enable docker" --upload
    

    Note

    Boot styles that use overlayfs (roram and iscsi) will not work because Docker does not support running on top of an overlayfs.

  3. Set up IP forwarding on the head node(s) for the node to access the external Internet, which likely involves using cw-modimg to add appropriate nameserver entries to the node's /etc/resolv.conf. See Compute Node Network Connectivity for details.

  4. Boot node n0 with the new DockerImage:

    cw-bootctl -i DefaultBoot clone name=DockerBoot
    cw-bootctl -i DockerBoot update image=DockerImage
    cw-nodectl -i n0 set _boot_config=DockerBoot
    
  5. Reboot node n0:

    cw-nodectl -i n0 reboot
    
  6. When node n0 is up, you can:

    • Initialize passphrase-less key-based access to allow your current administrator userid to ssh to the node. See OpenMPI, MPICH, and/or MVAPICH.

    • Login as root:

      sudo ssh n0
      
  7. As user root on n0 (if n0 can access the external Internet):

    [root@n0] docker run hello-world
    Unable to find image 'hello-world:latest' locally
    Trying to pull repository docker.io/library/hello-world ...
    latest: Pulling from docker.io/library/hello-world
    1b930d010525: Pull complete
    Digest: sha256:41a65640635299bab090f783209c1e3a3f11934cf7756b09cb2f1e02147c6ed8
    Status: Downloaded newer image for docker.io/hello-world:latest
    
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    
    To generate this message, Docker took the following steps:
     1. The Docker client contacted the Docker daemon.
     2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
        (amd64)
     3. The Docker daemon created a new container from that image which runs the
        executable that produces the output you are currently reading.
     4. The Docker daemon streamed that output to the Docker client, which sent it
        to your terminal.
    
    To try something more ambitious, you can run an Ubuntu container with:
     $ docker run -it ubuntu bash
    
    Share images, automate workflows, and more with a free Docker ID:
     https://hub.docker.com/
    
    For more examples and ideas, visit:
     https://docs.docker.com/get-started/
    

Note the Hello from Docker! line in the above output.