Docker Tutorials: Introduction

Docker is a great solution to the several problems,  such as the one of porting code and executables, and the one on installing software.

Docker logo

Docker logo

When we install software, we need a suitable environment. Just to make an example, some web apps need to have a certain version of php, others a different one. Configuring a machine with multiple versions of something (e.g. php)  may be feasible but complex. Moreover, sometimes we need to install certain supporting software just to test an app, that we later decide to drop: we are left with the now unnecessary stuff we’ve installed, or with the duty to correctly uninstall it.

When we port software to a different platform, we typically encounter a number of difficulties. A Java application may need a certain version of the APIs, and we need to make sure that our customer has installed it. Sure, we can include the java distribution in the jar, but resolving dependencies is not always that straightforward.

The Docker idea is close to the virtualization concept: we can create a virtual machine, and in that create the suitable environment for our app, and install it there.  Conceptually simple. However, that is not really virtualization, as Docker actually runs by reusing the kernel of the host machine – provided that is a Linux. If it is not, then there actually is a single VM running in the host, in the VM runs (only once) the Docker infrastructure that can host a number of “virtual environments” which take the form of Linux machines, and which are called “containers”. On the Mac, the docker distribution includes a VirtualBox VM which is automatically installed and run when needed. This is transparent, but has some implications (especially when working with the network layer).

Where do you start from to learn docker?

If you’re a Mac user, the right place is in the official site.

Why yet another tutorial?

There are a number of good Docker tutorials out there, especially those in the official site: the three videos (one hour each) are an excellent way to get oriented in the docker world. So why other tutorial?

Well, because not everything is immediately easy and straightforward. For instance, I had some difficulties in understanding how to install and deploy Apache in a container. Sure, I could have downloaded a ready-made image, but that would not have helped me understanding – and if you do not understand, the first problem you encounter is going to knock you out.

So I developed step-by-step examples which can be easily replicated, providing a guided learning path.

Here is the list:

  1. EXAMPLE OF CREATING A LINUX BOX INTO DOCKER
  2. MANAGING DOCKER CONTAINERS
  3. CREATING A LINUX BOX INTO DOCKER WITH A DOCKERFILE
  4. DOCKER IMAGES MANAGEMENT
  5. SHARING PART OF THE FILE SYSTEM WITH DOCKER
  6. INSTALLING APACHE2 ON DOCKER (ON A MAC) – PART 1
  7. INSTALLING APACHE2 ON DOCKER (ON A MAC) – PART 2: WRITING A Dockerfile

The tutorials will be made available over the next few days.

Advertisements
Tagged with: , ,
Posted in Docker

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: