I worked on a project recently where the client used Docker to create isolated containers for their applications. They highly recommended that I look at it, and based on their brief explanation of Docker I decided to make a go at it.
As it turns out, it seems like one of the coolest things since sliced bread. My (limited) understanding of it, is that it is basically a more granular method of virtualization. A Docker “image” is akin to a pre-configured environment (such as a windows OS image, or an Ubuntu OS image). An image can be more complicated than that, in that it may come pre-loaded with all sorts of extra stuff, but it is basically a “basis” for containers. Containers are more localized to a specific purpose, such as having a container for a specific application or service. Images are read-only, and cannot be changed, where-s as a container can change and evolve over time.
What I think is really cool, is that you can create a container based on another image. Later, you can push that container out for the rest of the world to use as a base image. Docker appears to use Git as a storage system. For example, you can commit changes to a container, and push the container to a public repository (such as the Docker hub).
Ironically, now that I know what (fundamentally) Docker is and does, I am noticing the term “Docker” popup everywhere. I’m seeing it in IDE’s such as WordPress and (even) Visual Studio). I’m seeing it in cloud hosted services such as Microsoft Azure and (I think) even Amazon’s EC2. I’m not sure how I went on so long not hearing of this amazing technology.
I got to thinking how this could be used in different scenarios, and in my IT Admin role, found a couple neat use-cases already.
For my personal website, I discovered that I had not paid any attention to it in a long time. As a result, it came down with a severe number of viruses due to outdated plugins and frameworks; to such an extent that it wouldn’t even start up. I wanted to setup a WordPress site on my local environment so that I could transfer the content of the website to it and get it back up and running before doing this in a live environment, but I did not want to install MySQL, re-download WordPress, re-configure it all, etc. Docker saved the day when I found that a simple good search for “Docker WordPress” came up with a #1 hit that provided a docker image that had WordPress pre-installed. Unfortunately, it did not have a MySQL database (that had to be installed separately), but there was a Docker “MySQL” image! So, I simply performed a “docker run” command for MySQL, and another “docker run” command for WordPress (with some command-line parameters to link the MySQL image to the WordPress image) and viola! I was up and running with a WordPress installation in no time.
For work, we are considering migrating our installation of Atlassian‘s JIRA to the Atlassian cloud… We have a great number of projects in JIRA and don’t want to migrate them all at the same time; we would prefer to iteratively migrate then project by project. Unfortunately, JIRA does not have functionality to export/import a single project in the cloud. However, the JIRA Server (self-hosted version of JIRA) has functionality to import a single project. So, we decided we could setup a new JIRA Server instance, and use it as a staging ground between our production JIRA Server instance and the JIRA Cloud that we want to migrate to. If you’ve ever setup JIRA Server, than you know it can be a pain. Docker to the rescue, again! A google search for “Docker JIRA” came up with another #1 result for a docker image that had JIRA Server pre-installed on it (and for a very recent version of JIRA Server. All we had to do was run “docker run” and a new installation of JIRA Server was online.
Now that I understand the basics of Docker, I’m sure I will be able to come up with many other uses for it.