Site Tools


New release available: 2022-07-31 "Igor". upgrade now! [52.2] (what's this?)
docker_base

Docker Basic setup

Images

As base system a Linux system with the Docker packages needs to be installed. Most Docker operations are carried out using the command 'docker'. Docker consists of images and containers. The GxFS Docker image is based on Debian Jessie, as this is the underlying operating system on the NetApp storage controllers,
First step to create a docker image is the Dockerfile:

FROM debian:jessie
LABEL vendor="Alexander Menck"
RUN echo "##### GPFS local repository ##### \n deb http://188.94.98.67/sscale_std_4232 ./" > /etc/apt/sources.list.d/gpfs.list   && \
    cat /etc/apt/sources.list.d/gpfs.list
RUN apt-get -y update && \
    apt-get -y upgrade && \
    apt-get -y install ssh apt-utils telnet iotop lsscsi sysfsutils sg3-utils multipath-tools nfs-common ntp curl vim-common && \
    apt-get -y --force-yes install gpfs.base gpfs.ext gpfs.gpl gpfs.gskit gpfs.gss.pmcollector gpfs.gss.pmsensors gpfs.license.std gpfs.msg
RUN mkdir /root/.ssh && \
    chmod 700 /root/.ssh && \
    curl http://repo.uxns.de/docker/ssh_cfg.tar | /bin/tar x -C /root/.ssh/  && \
    curl -o /etc/profile.d/gpfsvars.sh http://repo.uxns.de/docker/gpfsvars.sh
EXPOSE 22:22

The image created using this Dockerfile is based on a predefined Debian:Jessie image. The commands after the RUN statement are carried while the image creation. This example creates a repository and installs some packages. After that the tcp port 22 (SSH) will be accessible from outside to be able to log into the container once it is running.
To create the image the follwing command needs to be issued:

root@dockerhost:/repo/docker# docker build -f dockerfile-gxfs_v2 .
Sending build context to Docker daemon  5.632kB
Step 1/6 : FROM debian:jessie
jessie: Pulling from library/debian
ad74af05f5a2: Pull complete
Digest: sha256:51cd80bb935b76fbbf49640750736abc63ab7084d5331e198326b20063e7f13c
Status: Downloaded newer image for debian:jessie
 ---> 86baf4e8cde9
Step 2/6 : LABEL vendor "Alexander Menck"
 ---> Running in 69852ccb095d
 ---> ea44b2d947a9
Removing intermediate container 69852ccb095d
Step 3/6 : RUN echo "##### GPFS local repository ##### \n deb http://188.94.98.67/sscale_std_4232 ./" > /etc/apt/sources.list.d/gpfs.list   &&     cat /etc/apt/sources.list.d/gpfs.list
 ---> Running in 7e75f4fc1a8b
##### GPFS local repository #####
 deb http://188.94.98.67/sscale_std_4232 ./
 ---> 9918a7a0cfbb
Removing intermediate container 7e75f4fc1a8b
Step 4/6 : RUN apt-get -y update &&     apt-get -y upgrade &&     apt-get -y install ssh apt-utils telnet iotop lsscsi sysfsutils sg3-utils multipath-tools nfs-common ntp curl vim-common &&     apt-get -y --force-yes install gpfs.base gpfs.ext gpfs.gpl gpfs.gskit gpfs.gss.pmcollector gpfs.gss.pmsensors gpfs.license.std gpfs.msg
 ---> Running in 46bd10bf431b
Ign http://188.94.98.67 ./ InRelease
Ign http://188.94.98.67 ./ Release.gpg
Ign http://188.94.98.67 ./ Release
Get:1 http://188.94.98.67 ./ Packages [2470 B]
Get:2 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://deb.debian.org jessie InRelease
Get:3 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:4 http://deb.debian.org jessie Release.gpg [2373 B]
Get:5 http://deb.debian.org jessie Release [148 kB]
Get:6 http://security.debian.org jessie/updates/main amd64 Packages [555 kB]
Get:7 http://deb.debian.org jessie-updates/main amd64 Packages [17.8 kB]
Get:8 http://deb.debian.org jessie/main amd64 Packages [9063 kB]
Fetched 9997 kB in 2s (4249 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...

[...]

etting up gpfs.gskit (8.0.50-75) ...
Setting up gpfs.license.std (4.2.3-2) ...
Setting up gpfs.msg.en-us (4.2.3-2) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...
 ---> bc9b5e16f64e
Removing intermediate container 46bd10bf431b
Step 5/6 : RUN mkdir /root/.ssh &&     chmod 700 /root/.ssh &&     curl http://repo.uxns.de/docker/ssh_cfg.tar | /bin/tar x -C /root/.ssh/  &&     curl -o /etc/profile.d/gpfsvars.sh http://repo.uxns.de/docker/gpfsvars.sh
 ---> Running in ce25b25c7e79
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20480  100 20480    0     0  2414k      0 --:--:-- --:--:-- --:--:-- 2500k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    36  100    36    0     0   5346      0 --:--:-- --:--:-- --:--:--  6000
 ---> e589e271d455
Removing intermediate container ce25b25c7e79
Step 6/6 : EXPOSE 22:22
 ---> Running in eefd937dd27b
 ---> 9d9ed823d754
Removing intermediate container eefd937dd27b
Successfully built 9d9ed823d754
root@dockerhost:/repo/docker#

Docker Images can be displyed using the follwing command:

root@dockerhost:/repo/docker# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
<none>              <none>              9d9ed823d754        8 seconds ago       425MB
debian              jessie              86baf4e8cde9        3 weeks ago         123MB
root@dockerhost:/repo/docker# docker images --all
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
<none>              <none>              9d9ed823d754        16 seconds ago      425MB
<none>              <none>              e589e271d455        17 seconds ago      425MB
<none>              <none>              bc9b5e16f64e        21 seconds ago      425MB
<none>              <none>              9918a7a0cfbb        3 minutes ago       123MB
<none>              <none>              ea44b2d947a9        3 minutes ago       123MB
debian              jessie              86baf4e8cde9        3 weeks ago         123MB
root@dockerhost:/repo/docker#

Container

creating a container

To create a container the 'docker run <image ID>' need to be issued. The -ti parameters takes care that a tty is started to access the container directly in interactive mode.

root@dockerhost:/repo/docker# docker run -ti 9d9ed823d754
root@bb49a77694ba:/# hostname
bb49a77694ba
root@bb49a77694ba:/# exit
exit
root@dockerhost:/repo/docker#

After that the container is created and can be listed using 'docker container list –all'

root@dockerhost:~# docker container list --all
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
bb49a77694ba        9d9ed823d754        "bash"              2 minutes ago       Exited (0) 6 seconds ago   22/tcp              reverent_euler
root@dockerhost:~#

Once the container is created using the 'docker container run' commmand it can started again using the 'docker container start <container ID>' command.

root@dockerhost:~# docker start bb49a77694ba
bb49a77694ba
root@dockerhost:~# docker container list --all
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
bb49a77694ba        9d9ed823d754        "bash"              20 minutes ago      Up 4 minutes                22/tcp              reverent_euler
80d125a329e2        9d9ed823d754        "bash"              28 minutes ago      Exited (0) 21 minutes ago                       lucid_euler
root@dockerhost:~# docker stop bb49a77694ba
bb49a77694ba
root@dockerhost:~# docker container list --all
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
bb49a77694ba        9d9ed823d754        "bash"              20 minutes ago      Exited (0) 2 seconds ago                        reverent_euler
80d125a329e2        9d9ed823d754        "bash"              28 minutes ago      Exited (0) 21 minutes ago                       lucid_euler
root@dockerhost:~#

To attach to the container 'docker attach <container ID>' can be used. To exit this interactive conection don't use ctrl-c, as this stops the container. The key sequence ctrl-p follwed by ctrl-q will exit this interactive shell.

root@dockerhost:~# docker attach bb49a77694ba
root@bb49a77694ba:/# read escape sequence
root@dockerhost:~#

GxFS Setup

working Dockerfile:

FROM debian:jessie
LABEL vendor="Alexander Menck"
RUN echo "##### GPFS local repository ##### \n deb http://188.94.98.67/sscale_std_4232 ./" > /etc/apt/sources.list.d/gpfs.list
RUN apt-get -y update && \
    apt-get -y upgrade && \
    apt-get -y install supervisor ssh apt-utils telnet iotop lsscsi sysfsutils sg3-utils multipath-tools nfs-common ntp curl vim-common && \
    apt-get -y --force-yes install gpfs.base gpfs.ext gpfs.gpl gpfs.gskit gpfs.gss.pmcollector gpfs.gss.pmsensors gpfs.license.std gpfs.msg
RUN curl http://repo.uxns.de/docker/dotssh.tar | /bin/tar x -C /root/  && \
    curl http://repo.uxns.de/docker/etcssh.tar | /bin/tar x -C /etc/ssh/  && \
    curl -o /etc/profile.d/gpfsvars.sh http://repo.uxns.de/docker/gpfsvars.sh && \
    curl -o /etc/supervisor/conf.d/sshd.conf http://repo.uxns.de/docker/sshd.conf && \
    mkdir /var/run/sshd
#CMD ["ls",  "-l", "/"]
#CMD ["ls", "-l", "/bin/bash"]
#ENTRYPOINT /etc/init.d/ssh start && bash
EXPOSE 22:22
#CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
#CMD ["/usr/sbin/sshd"]
CMD /usr/sbin/sshd && /bin/bash
#ENTRYPOINT /bin/bash

steps to create network environnment and GxFS container:

root@dockerhost:~# docker network create --driver bridge --subnet 10.1.20.0/24 gxfs_net
root@dockerhost:~# docker create -t --name gxfs22 --hostname gxfs22 --ip 10.1.20.22 --network gxfs_net -v varmmfs22:/var/mmfs 300ca37c3045
root@dockerhost:/repo/docker# docker create --privileged --cap-add=ALL -v /dev:/dev -v /lib/modules:/lib/modules -t --name gxfs80 --hostname gxfs80 --ip 10.1.20.80 --network gxfs_net -v varmmfs23:/var/mmfs 300ca37c3045
35056b2ad191492306a07eec97cb24746baa990647394728fbb49edd93f0ae3f
root@dockerhost:/repo/docker#
docker_base.txt · Last modified: 2022/07/10 09:34 by 127.0.0.1