Overview

Docker configuration is done in the YML files, where we should describe what we want and how that should be linked in regards to:

Storage

Network

Ports

Installation

Docker is open source application and can be freely downloaded and installed. Now it is important to notice that, in general docker installed on Windows will run windows apps and docker installed on Linux will run Linux apps. Of course, there are exception of that rule and Linux docker can run Windows apps, but that is story for another time. Docker is easily installed as follows:

Install the package

You can install the package using your favorite package manager, in my case “yum”

Start the service

Run "Hello World"

Configurations

With docker we can download and run any image from a registry. Currently there are over 3 million dockerized applications including:

Databases

Web Services

Operation Systems and others

You can download and run such images from any registry, but the most popular is: | this one.

Let's start by downloading and installing MySQL database which has been dockerized.

MySQL Configuration

Once we have docker installed, we can search and install any image we want:

Install MySQL

Now we can install the mysql image using the following commands:

Download (pull) MySQL)

[root@localhost ~]# docker pull mysql Using default tag: latest latest: Pulling from library/mysql be8881be8156: Pull complete c3995dabd1d7: Pull complete </sxh>

We can check installed images of course and see how much space they occupy:

Start the MySQL

We can see now, that I have installed 2 mysqls, we can initiate a new container for mysql image as follows:

Check Logs

We can check the logs of the installation as follows:

Finally, we can connect to the mysql, by running the mysql command from the docker:

Mongo Configuration

Other configuration which can use is for Mongo database:

In case of changes, you have to restart the container is follows: