Been playing a little with Docker this afternoon, while its something I have been aware for a while its not something I have really looked into.

As I prefer working with CentOS rather than Ubuntu its taken me a while to get the motivation to do any more than some reading, however as the latest version now runs on RHE compatible

yum install <a href="http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm" target="_blank" data-href="http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm">http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm</a><br>yum -y install docker-io<br>service docker start<br>chkconfig docker on

Once the services are installed pull down some images to test with;

docker pull ubuntu<br>docker pull centos<br>docker run centos /bin/echo hello world

the last command launches a CentOS container, runs the echo and then exits. To do something more interesting;

CONTAINER_ID=$(sudo docker run -d ubuntu /bin/sh -c “while true; do echo hello world; sleep 1; done”)<br>docker ps<br>docker attach -sig-proxy=false $CONTAINER_ID<br>docker logs $CONTAINER_ID<br>docker stop $CONTAINER_ID

Once you have some containers running the following commands are useful;

docker info # Get some information on the installation<br>docker images # List the available images<br>docker ps # Whats running?<br>docker search [TERM] # Search for images

This is probably one of the better introductions to Docker I have seen;


and some further reading;


Russ McKendrick

Buys way too many vinyl records, writes a lot about Docker & loves orchestration. Works at @node4ltd / @n4stack has written for @PacktPublishing

Read More