Getting Started with Docker

      3 Comments on Getting Started with Docker

Docker-logo-011

It can’t be helped.  There’s just too much cool stuff out there and not enough time to spend dedicating myself to one piece of technology.  That being said, I fully intend on continuing the Chef posts, but Im going to be mixing in some docker posts as well.  Im hoping that there’s some cross-connect as well where we can talk about using docker in conjunction with Chef as well.

Docker is something that I haven’t seen before.  From what I have seen so far, it appears to be an incredibly easy way to containerize applications and software on a linux system.  The docker website summarizes docker as..

“An open platform for distributed applications for developers and sysadmins.”

That summarizes things nicely, but again, why is a network guy interested in this?  First off, I’m a little tired of VMware.  Don’t confuse me being tired with a general dislike of the product.  I’ve been using VMware for years and for the most part, it works well and provides the functions I need.  On the flip side, Im not convinced there’s anything particularly special about VMware.

I’ve been using ProxMox at home for some time and it does everything that I need and more.  Why?  Well, it’s free, it works, and it has a GUI which made a nice transition for me from VMware land.  Second, VMware has a clever way of supporting less and less ‘whitebox’ systems.  An obvious move to make supporting their product easier, but not a win for the guys who want virtualization on any old box.

I guess the question I’ve been asking myself more and more is if there’s anything special about VMware besides the GUI (which directly correlates to ease of use).  VMware has been an obvious choice for a virtualization platform for a long time.  It’s easy to use, has all the advanced options if you want it, and has a wide base of deployment.  However, Im starting to think that some of these other technologies are going to start nipping at the VMware market share.  Will they completely displace VMware?  Certainly not, but I do think they’ll compete and I certainly think there’s nothing healthier than companies competing to make the best products possible.

So let’s get right into the install!  I think you’ll find that installing docker is easier than you thought it might be.  By the end of the post we’ll have docker installed and tested on a CentOS 6.4 host.  In upcoming posts we’ll talk about docker concepts and how to use docker to accomplish a variety of tasks.

Installing Docker
As I mentioned, the docker install is very easy.  We’re going to start off with a freshly installed CentOS 6.4 minimal install.  I’ve done the following things to the physical host prior to beginning the initial configuration

-Configured the IP address (this can be done during install)
-Configured the hostname (this can be done during install)
-Configured a name server (Edit /etc/resolv.conf)
-Disabled SELinux to make my life easier (Yes, I know.  Its OK though)
-Disabled the IPTables service (I dont need a firewall)
-Ran a ‘yum update’ (make sure current packages were up to date)

So now that we have that done, let’s start the docker install.  The install can be broken into 4 main steps.  I’m sort of laughing about breaking it up at all since it’s so easy but I think this further proves my point of how quick and easy the install is.

1. Install the PreReqs
The ONLY prerequisite for installing docker is having some means to download and install the EPEL repository.  In my case, I do that with WGET.  So let’s install that quick…

Screen Shot 2014-06-13 at 3.19.31 PM

2. Configure the EPEL repository
The next step is to install the EPEL repository which is where we’ll download the docker application from.  This is done by running these 3 commands…

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Let’s run them quick on our host…

Screen Shot 2014-06-13 at 3.41.56 PM


3. Install docker
At this point, all we have to do is install docker.  That’s done with this command..

yum install docker-io

Let’s run that quick to wrap up our install…

Screen Shot 2014-06-13 at 4.04.36 PM

Start docker and configure it to load at boot
Now that we have it installed, we need to start the docker service and tell it to load when the server boots.  This is done with these two commands…

service docker start
chkconfig docker on

Let’s configure that…

Screen Shot 2014-06-13 at 4.09.50 PM

And thats it.  Boiled down, to install docker I ran this set of commands…

#Install PreReq of wget
yum install wget

#Download and configure EPEL repository
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

#Install Docker
yum install docker-io

#Start Docker and configure it to load at boot
service docker start
chkconfig docker on

To make sure it’s working let’s run a couple of quick verification commands…

Screen Shot 2014-06-13 at 4.14.13 PM

The first command ‘docker version’ asks docker to tell us what the current installed version is.  The second command asks docker to pull a base image called ‘centos’ from the public repository.  This confirms that the docker host has outbound connectivity to the docker public repository.  Now lets check to see that docker sees the image we just downloaded…

Screen Shot 2014-06-13 at 4.14.01 PM

And there you have it!  Docker is now fully installed and appears to be working.  While I hate to leave you hanging here, it’s time to wrap this post up.  I promise the next post on using docker will come soon, Im anxious to spend more time with it!

3 thoughts on “Getting Started with Docker

    1. Jon Langemak Post author

      Hi Martin – I guess it depends on what you’re testing. If you can accomplish what you need with docker files or collapsed images it might be more efficient. Then theres the learning curve. Proxmox is easy. What are your thoughts?

      Reply
  1. Pingback: docer网络连接 - my

Leave a Reply

Your email address will not be published. Required fields are marked *