Tuesday 16 February 2016

Train Data Guard with Docker 1.10.1 and Docker Compose 1.6.0

Important tech news brought us to  change our Docker Data Guard Project. Please see my posts Start Oracle Data Guard Training with Docker and Docker managed via upstart, too.  The actual Docker release is stable. NOTE: the daemon used to be started with "/usr/bin/docker -d". From now on you start it - manually - like that

root@Thinkpad4:~# docker daemon > docker.session 2>&1 &
[1] 2422
root@Thinkpad4:~# ps -ef | grep docker  | grep -v grep
root      2422 10277  8 14:52 pts/8    00:04:40 docker daemon

For the details see /etc/init/docker.conf  and take a diff on

root@Thinkpad4:/etc/init# diff docker.conf docker.conf.dpkg-old
3,4c3,4
< start on (filesystem and net-device-up IFACE!=lo)
< stop on runlevel [!2345]
---
> #start on (local-filesystems and net-device-up IFACE!=lo)
> #stop on runlevel [!2345]
42c42
< exec "$DOCKER" daemon $DOCKER_OPTS
---
> exec "$DOCKER" -d $DOCKER_OPTS

Calling the docker client did not change:

hwk@Thinkpad4:~$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
oraclelinux         standby1            858c15b50894        12 days ago         8.959 GB
oraclelinux         primary             b82813515f07        12 days ago         11.01 GB
oraclelinux         oracle12c           9d102fc4752f        2 weeks ago         8.955 GB
oraclelinux         step1               b4c551e2eb65        2 weeks ago         758.2 MB
oraclelinux         7.2                 8ece2d809023        10 weeks ago        205.9 MB

Even the images created with Docker 1.7.1 survived the new installation of Docker 1.10.1. An interesting enhancement is Docker Compose, able to run multi-container applications with docker. It is located in 

hwk@Thinkpad4:~$ ll /usr/local/bin/docker-compose 
-rwxr-xr-x 1 root root 7940602 Feb 15 21:51 /usr/local/bin/docker-compose*

A client user calls it always with a docker-compose.yml. You may test the installation e.g. with a docker-compose.yml like that

hwk@Thinkpad4:~$ cat docker-compose.yml 
helloworld:
    image: hello-world

and type

hwk@Thinkpad4:~$ docker-compose -f ./docker-compose.yml up

Look at the result, which took half a minute:

Pulling helloworld (hello-world:latest)...
latest: Pulling from library/hello-world
03f4658f8b78: Pull complete
a3ed95caeb02: Pull complete
Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
Status: Downloaded newer image for hello-world:latest
Creating hwk_helloworld_1
Attaching to hwk_helloworld_1
helloworld_1 | 
helloworld_1 | Hello from Docker.
helloworld_1 | This message shows that your installation appears to be working correctly.
helloworld_1 | 
helloworld_1 | To generate this message, Docker took the following steps:
helloworld_1 |  1. The Docker client contacted the Docker daemon.
helloworld_1 |  2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
helloworld_1 |  3. The Docker daemon created a new container from that image which runs the
helloworld_1 |     executable that produces the output you are currently reading.
helloworld_1 |  4. The Docker daemon streamed that output to the Docker client, which sent it
helloworld_1 |     to your terminal.
helloworld_1 | 
helloworld_1 | To try something more ambitious, you can run an Ubuntu container with:
helloworld_1 |  $ docker run -it ubuntu bash
helloworld_1 | 
helloworld_1 | Share images, automate workflows, and more with a free Docker Hub account:
helloworld_1 |  https://hub.docker.com
helloworld_1 | 
helloworld_1 | For more examples and ideas, visit:
helloworld_1 |  https://docs.docker.com/userguide/
helloworld_1 | 
hwk_helloworld_1 exited with code 0

To be continued in future posts.

No comments: