Docker Training Mumbai

Docker Training Mumbai – Fasttrack / Online / Corporate Trainings Available

Docker Training Mumbai

Containers everywhere! Getting started with Docker – Learn from Experts!

Docker Training Mumbai course is aimed at software engineers and system administrators that want to deliver better software. Other IT professionals can also take this course, but might have to do some extra research to understand some of the concepts. Docker is the name on the tip of many tongues at the moment. It is a containerisation engine which allows you to package up an application along with all the settings and software required to run it and deploy it to a server with a minimum of fuss.

So where did this idea come from?

Shipping containers! Shipping containers have a defined size. No matter what they contain the cranes used to move shipping containers about and the boats that load them know how to stack them. A shipping container is a standardised unit. Imagine if software was the same. Rather than needing to know how to setup a server to the exact specifications given by a program, you are given a container. The container engine knows how to move that container about and how to run it, no matter what is inside.

How is this different from virtual machines?

Well, virtual machines are also individual boxes, with all the requirements for some software inside them. However, they also emulate the hardware constraints (the ship and the crane from our docks).

This can be useful if you want to change the CPU that the machine is running on, or restrict the amount of memory available to a machine, but it has overheads. These overheads mean that we are restricted in the number of virtual machines we can have on a single server.

Containers don’t use hardware emulation, it’s all about the software. So you can run more of them on a single machine. As well as that, Docker takes advantage of shared file systems. It builds up its container in terms of layers. The base layer is the operating system. The next any updates and file changes that occur.

If there are two containers that can share some of this file system then they do so. This reduces the space required for each container as it only contains what is different about its setup, rather than repeating the same information over and over.

So how does it work?

Docker Training in Mumbai

Step 1: Download Docker for your operating system.

It is based on Linux Containers (LXC) so if you are running Windows or OS X then you will need a wrapper for the program. Luckily, one is provided for you via ‘docker-machine’. If you run Linux already, then you can use it natively.

Step 1.5: Start ‘docker-machine’ if required.

docker-machine create default --driver virtualbox

This will create a small linux virtual machine using virtual box as its driver. There are other drivers for different virtualisation systems. Now we need to connect to this. List the system settings for your virtual machine with:

docker-machine env default

Then we connect to it!

Mac: eval $(docker-machine env default)

Windows: docker-machine env --shell=powershell default | Invoke-Expression

Step 2: Create your first machine and say hello!

docker run ubuntu echo 'hello world'

That’s it. It’s that simple. Docker creates a container using ubuntu as its base layer and runs whichever commands you give it. In this case we used the echo program to say ‘hello world’.

Pre-defined containers

We can build up containers based on running each command individually with the docker binary, but that would take a while. It doesn’t match with the idea of ‘automate everything’ that has come from the sys admin and devops world.

The solution for this problem are “Dockerfile”s. A Dockerfile is a script which tells the container how to build and run.

A Dockerfile could be defined as:

from centos:centos6

run yum update -y

run yum install -y java-1.7.0-openjdk

run yum install -y java-1.7.0-openjdk-devel

copy hello.java /

run javac hello.java

This uses centos 6 as its base image, updates everything, installs java, copies in a file and then compiles it. When we run this with this, the java file will execute!

docker build -t containername . #build the container

docker run containername java hello #run the program!

Dockerfiles are incredibly flexible and can handle copying in resources from other containers, the internet or your local system. Anything that you would run on the command line is pre-pended with the “run” statement. By defining containers using these files we can version control and test them. This leads to more reliable deployments.

 

Composing containers

All looks good so far? Docker goes a step further when automating everything. With docker-compose we can define and start up many containers at once.

This means our entire infrastructure is defined in readable files which can be version controlled and tested.

mysqldatabase:

image: mysql environment:

MYSQL_ROOT_PASSWORD:

rootpassword php: image: phpapache

ports:

– “80:80”

links:

– mysqldatabase:

Containers are a powerful and easy way to manage your code deployment to servers, they are flexible enough to allow for any set of requirements of your software and allow you to automate all the things!

After all, wouldn’t it be nice if setting up a minecraft server was as easy as:

docker run -d -p=25565:25565 itzg/minecraft-server

 

 

 

Docker Training Mumbai

Contact us

Mail: info@bigdatatraining.in
Call: +91 9789968765 / 044 – 42645495

Weekdays / Fast Track / Weekends / Corporate Training modes available

Docker Training Also available across India in Bangalore, Pune, Hyderabad, Mumbai, Kolkata, Ahmedabad, Delhi, Gurgon, Noida, Kochin, Tirvandram, Goa, Vizag, Mysore,Coimbatore, Madurai, Trichy, Guwahati

On-Demand Fast track Apache Spark Training globally available also at Singapore, Dubai, Malaysia, London, San Jose, Beijing, Shenzhen, Shanghai, Ho Chi Minh City, Boston, Wuhan, San Francisco, Chongqing.