Steep learning curve
On day one I find myself in the Docker departure lounge and I’m still trying to work out why I’m travelling by ship when I could be flying on a Virtual Machine. As my journey into Docker land continues I find lots of good reasons to be here and wonder why it’s taken me so long to travel this way.
What is Docker?
It’s a question I have asked myself for the past couple of years and never had the time or inclination to find out. Now I have a potential customer using Docker to run IBM Domino and one of BCC’s products, I figured I should see if this is going to work before I try and talk knowledgeably to the customer about it.
Here is my take on what Docker is and why it’s not a Virtual Machine that we’ve been used to in the past.
- As any reference material that you search for on <<your fav search engine>> you don’t need the whole operating system for most things you want to do in a VM, but you have to run the whole lot. Not with Docker! You only end up with what you need in the final ‘thing’ you run. (I’ll cover what things are called later)
- It’s a lot faster than a whole VM. “Yeah Duh! Thanks for that blinding inspiration Einstein.” The images below show a comparison between a Docker “Container” on the left and a traditional VM on the right. The container for my resulting CentOS 7 with Domino 9.0.1 FP 10 server is about 5.5GB. Compare that with a full blown VM for the same of at least 20-30GB.
- Names can cause confusion until you ‘get the concept’. So here is a little story to explain the concept of Docker, Containers and Images.
I wanted to move to a new house from one town to another but I had a lot of stuff to move. When I went to the moving company they asked me what I needed to move, and could they provide me with the right sized box for the stuff I have to move. I asked for 10 large boxes, 25 medium, 50 small and 10 wardrobe boxes. We also arranged for 3 large wooden crates, 2 for my motorcycles and 1 for my pedal cycles. Two weeks before the move I got delivery of all the boxes, but they were flat packed to save space. I got a box full of packing tape and marker pens to set everything up with.
We merrily went about the house taking flat boxes to all the rooms, unfolding them and taping the bottom to make sure it was secure. We’d write the name of the room and what was going in that box with the marker pen. When we had filled the box with ‘stuff’ it was taped shut for the movers to come and collect and load into the truck the day before we moved.
- Docker is like the moving company that can provide the right stuff when you need it.
- Images are the boxes that were supplied in flat pack form. This is like downloading an image from the Docker store. Unfolding the box is like uncompressing the image on your local system and then you fill it with the right code to do your task.
- Containers are like the boxes that you have filled, labelled and sealed to be moved. They are specific to the task, the right size and only used for what you have packed inside them.
- Another reason I’m smitten with this setup is because I’ve effectively been given a ‘snapshot’ of each step of the process of creating an Image that I can turn into a container.
Let me expand this theory a little.
- Create a base CentOS image. Now I can base any further images or containers on that one and I never have to ‘build’ it again. (200MB)
- Create a new image from the CentOS image and install Domino 9.0.1 into it. (2.73GB)
- Create another new image from the Domino 9.0.1 image and install FP10. (5.5GB)
- Lastly, create an image from your Domino 9.0.1 FP10 image that is configured to start up or wait in setup mode if it’s not configured.
This now allows me to create a new Domino server container in about 5 minutes apply whatever fixes I want to it and cookie cut that out into as many running images as I need.
This is great if you want to run up multiple servers quickly, in a small environment and tweak them all at run time. I can maintain one ‘server code base’ and all instances running from it will be the same as soon as I refresh them with a single command for each one.
What about if I want to have one image running the http task for my Domino environment and one image just running the indexer or database server parts of Domino? Well that may well be coming in the future, we’ll have to wait an see.
Next time I’ll cover how I got started, 3 times, and why Docker on Mac seems to be pointless. (I hope someone can prove me wrong)