DockerOps??? - Getting Started With?? Docker
Introduction
Today, almost everyone has at least heard of Docker and the term containerization. It doesn't matter whether they are experts in building container-oriented services, or whether they know how containers function. But they have stumbled upon a document, or ebook, magazine, article, or a video that talks about a containerized application, orchestration tools, or Docker, Kubernetes anything. The point is that people are aware of the technology, and the same evolution of the virtual machine stack, that everybody knows. That is pretty much old school now. What I want to do in this Docker 101 class, is to establish the core fundamentals of the Docker setup, how it works, how you can quickly get Docker, and how to try it out.
I will try my best to cover all the aspects of Docker, and containerization of the applications with this tutorial collection of the articles. Among a few topics about Docker itself, we will explore:
- Data persistence in a container
- Services in Docker
- Container orchestration
- Kubernetes and Docker
These are a few of the topics that I can discuss without actually making beginners lose track, or experts call me a geek.
What is Docker?
A short definition for those, who still don't know what Docker is, and why they should care about it: When people talk about Docker, they think of a containerization tool, or some even think of it as a process orchestrator. They are all correct. Docker is, and can be thought of, as a:
- Package manager
- Orchestrator
- Load Balancer
And I didn't even mention all the other things, that you can find on the internet like, Docker is a product developed by the company of the same name, or, Docker is an open source containerization management tool or another one like Docker is the gateway to the cloud. They are all right in their own perspective, but still, that does not just cover everything that Docker can do. That is why I am writing this article, to showcase the functionality and features of Docker, instead of talking about it. Let's start with the requirements and prerequisites for Docker.
Platform and Requirements
Docker itself is available to be installed on Linux, Windows or macOS, but I would be utilizing Linux platform here. The commands and Docker behavior will be similar on Windows as well as on macOS. But I assure you, it would be an amazing ride if you join using a Linux distro, and especially if you choose to setup Ubuntu installation 16.04 or latest. I have used Ubuntu 18.04 for this setup.
The second thing to note here is that I am using Snaps, the Snapcraft. The reason behind this step and selection is that snaps are really very easy to install, upgrade and manage. They come shipped with the services, programs, and utilities that enable you to manage the utility quite easily. Do not worry, in the section for installation and setup, I will explain and provide guidance on other installation and requirements too as needed, but the primary method is this one.
Installation and Configuration
As discussed, we will be installing the snaps for the Docker and, for those who want to learn some advanced topics of orchestration, Kubernetes. Snaps are available on Linux distributions, the ones that are released recently in 2018, or 2017. The installation process is clearly stated and mentioned on the Docker website, anyways I will still try to explain the method on a few of the platforms.
Windows
On Windows, the only things you need to make sure of before executing the installer for Docker are:
- Hardware virtualization
- Hyper-V to be installed and enabled
This also means that you cannot try this stuff out on Windows Home edition. You would require to have, Windows Pro or onwards edition for this. But this will not prevent you from trying out the Docker installation on a virtualized environment, and there you can easily set up Linux distro and get started with the next section.
But if you already have a Pro edition of Windows, just head over to Docker downloads and install Docker for your machine.
Linux (Ubuntu 18.04)
Although any of the Linux distribution that supports Snaps would work, I am going to use the Ubuntu distribution in the rest of the article as well as the articles that follow-up after this one. So to do that, just make sure you have the snaps available for your system. To make sure you are having the snap system installed, either make sure that you are running Ubuntu 16.04 or onwards, that is why I recommended using Ubuntu 18.04. Snaps daemons are installed by default on these operating systems, and in case the following command doesn't give a response,