User Tools

Site Tools


hpc:docker

Using Docker

Some initial tests

I installed Docker on my Macbook, it was quite easy following the directions on the <html><a href='https://www.docker.com/' target='_blank'>Docker website</a></html>.

I played around a little and located an SLC docker image. In a fresh terminal:

->boot2docker init
->boot2docker start
->export DOCKER_TLS_VERIFY=1
->export DOCKER_HOST=tcp://192.168.59.103:2376
->export DOCKER_CERT_PATH=/Users/childers/.boot2docker/certs/boot2docker-vm
->docker search slc6
NAME                          DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
cern/slc6-base                Scientific Linux CERN 6 image ready to use...   2
cern/slc6-lite                Lightweight CERN Scientific Linux 6 image       1
cmssw/slc6-vanilla                                                            0
lvarin/slc6_vcs               Personal slc6 image for VCS                     0
asgc/slc65                    Image forked from cern/slc6-base                0
lvarin/slc6_64                Base SLC6 image, no modifications from the...   0
acasajus/slc65                                                                0
anaderi/slc6-devtoolset_1.1                                                   0
cmssw/slc6-externals                                                          0
-> docker pull cern/slc6-base
Pulling repository cern/slc6-base
3d85e4d2d936: Download complete
beca1e02f1eb: Download complete
79924a46c804: Download complete
Status: Downloaded newer image for cern/slc6-base:latest
-> docker pull cern/slc6-base:6.5
-> docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
cern/slc6-base      6.6                 3d85e4d2d936        12 weeks ago        911.1 MB
cern/slc6-base      latest              3d85e4d2d936        12 weeks ago        911.1 MB
cern/slc6-base      6.5                 79924a46c804        6 months ago        402 MB
-> docker run cern/slc6-base:6.5 uname -a
Linux f4eea7db246b 3.16.7-tinycore64 #1 SMP Tue Dec 16 23:03:39 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

As a test I installed ROOT via yum into the image. The first command here starts an interactive container.

-> docker run -i -t cern/slc6-base:6.5
[root@19035251353f /]# yum install root.x86_64
.
. < yum installation STDOUT goes here >
.
[root@19035251353f /]# root -b
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/20    12 August 2014   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************
 
ROOT 5.34/20 (heads/v5-34-00-patches@v5-34-19-251-gfb37e88, Aug 29 2014, 05:50:00 on linuxx8664gcc)
 
CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .q
[root@19035251353f /]# exit
-> docker ps -l
CONTAINER ID        IMAGE                COMMAND             CREATED             STATUS                     PORTS               NAMES
19035251353f        cern/slc6-base:6.5   "bash"              29 minutes ago      Exited (0) 3 seconds ago                       ecstatic_brattain
-> docker commit -m "SLC6.5 with ROOT 5.34/20 installed" -a "Taylor Childers" 19035251353f jtchilders/slc65:root534
e0ebe08a3fce057499fcefdf6132c7e57aca605a1830f0abc84f97e431094cb2

Now I have my own SLC6.5 container with ROOT 5.34 installed.

Next I played with trying to run a root script so I made one:

mkdir vlocal
vim vlocal/root_test.C
| root_test.C
#include <string>
#include <iostream>
 
int root_test(void){
   string test = "Hello World";
 
   std::cout << test << "\n";
 
   return 0;
}

Then I wanted my container to mount my local directory and use this file:

-> docker run --volume=$PWD/vlocal:/vcont jtchilders/slc65:root534 root -b -q /vcont/root_test.C
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/20    12 August 2014   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************
 
ROOT 5.34/20 (heads/v5-34-00-patches@v5-34-19-251-gfb37e88, Aug 29 2014, 05:50:00 on linuxx8664gcc)
 
CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
 
Processing /vcont/root_test.C...
Hello World
(int)0
hpc/docker.txt · Last modified: 2015/05/20 19:52 by jchilders