What is Docker?
Docker is a Software Containerisation Platform. Everything in the world of Docker is a Container. With Docker on board, developers do not have to worry about the environment setup for a program to run the program on his/her PC. This is due to the fact that the containers take care of the necessary configurations. Hence why the logo of Docker contains a whale who carries containers. The containers help the whale to ship the products easily. This itself gives out the concept of dockers.
The containers contain the following:
- Operating System
- Software that you build
- Dependancies to run the software
- Environment variables, etc
With Docker, the developers worry less about the environment a program runs in and focuses more on developing better software. Docker automates the repetitive tasks of setting up and configuring development environments so that developers can focus on what matters: building great software.
What does a container do?
A container can be thought of as a self-contained machine which has it’s own OS, file system, etc. A container can run only one application at a time. Everything required to build a piece of software is packaged into this container. The difference between a VM and a container is that containers do not contain the whole operating system – but parts of the operating system (libraries and settings) which are required to run the software. This makes containers more efficient over VMs.
Containers can run on any computer, any infrastructure, any cloud platform and shared the kernel with other containers. Therefore once an application is built using Docker, it can be run on any machine without any problems occurring in the setting up of the application.
This solves the problem which developers have; “The applications runs in your machine, but not in mine.”
Docker provides consistency. The developer does not have to worry about the environment the program is run on. Everything needed is packaged into the isolated containers. Once a developer receives the container, they would know that the box contains everything which is required to run the program.
The docker engine in the docker infrastructure contains a mini operating system, which takes care of the functionality of the guest operating systems in the VM infrastructure. Dockers are more popular than VM’s because the additional space and memory required for guest OS’s are completely removed by the docker engine.
Docker operates on the basis of :
Build the container, ship it and then run it on any machine. Docker can be used for automation testing as well.
Install Docker for Mac OS X
Pre-requisites: A Mac running OS X version 10.8 (Mountain Lion) or later. Display the version by clicking the Apple icon the top-left of your screen, and then selecting About this Mac.
- Visit the Docker Toolbox page. ( https://www.docker.com/products/docker-toolbox )
- Download the Toolbox version for Mac. (The toolbox contains the Docker Engine, Compose, Machine and Kitematic)
- Follow the steps to install, after the double-clicking on the installation file
- After the installation, the installer provides you with short-cuts, which can be ignored and continued.
- Once the success message for the installation appears, click on Close.
Setup Docker for Mac OS X
- Open the launchpad and click on the Docker QuickStart terminal icon.
- Next type on the terminal,
docker run hello-world
If, the “Hello from Docker” message is received, Docker is up and running!
hello-world image is not on your local system, the Docker client might take a minute to pull the image from Docker Hub.