It's about open source softwares

Wednesday, May 27, 2015

Docker on Windows

      Day by day, Docker becoming very famous as it changes the process of building, deployment, shipping of applications with the help of operating system level virtualization technology called containers

Docker, What it is? 


      Docker is an open source projects that automates the deployment of applications inside containers. It uses operating system virtualization technology. It uses linux kernel features like resource isolation CGROUPS and kernel namespaces.

      Docker container is a virtual environment running on host operating system similar to virtual machines. The main difference between traditional virtual machine and container is that they all shares host machine kernel instead of having separate one for each container. Because container doesn't have their own kernel its very lightweight virtual machines.

This post describe the installation process of docker on windows using Boot2Docker.
   

Boot2Docker


Docker uses Linux kernel specific features. So that we required lightweight virtual machine to run docker on windows. Boot2Docker is nothing but lightweight linux distribution which is used for docker container on windows.
It runs in approx. 27MB RAM and boot in approx. 5 Sec.
Boot2Docker internals
Here, we are going to use docker on windows operating system, but internally it running docker engine on linux virtual machine(Boot2Docker). On Docker server we build, run, stop or download containers. We are only accessing or communicating with docker server using windows docker clients.

Installation


1. Download latest installer of boot2docker for windows from https://github.com/boot2docker/windows-installer/releases/latest

2. Click and run installer

3. Installer installs windows docker client, Boot2Docker management tools and ISO, virtualBox, MSYS-git Unix tools.
    If virtual box and MSYS-git unix tools were already installed on your machine then installer doesn't install it.  

4. Select check box for desktop icon creation and adding docker executable to environment variables (PATH) 


5. Complete the installation by clicking finish button


6. Start boot2docker by clicking desktop shortcut or using program files -> Boot2Docker for windows.
    This will starts the docker engine and set the environment variables. 
    You can check the docker version by running "docker version" command. 



You can also see Boot2docker VM running in VirtualBox. 


Run "hello-world" docker container


Boot2Docker installer provides us "hello-world" image which only prints the hello message when we run container to verify the installation. You can run your first container simply typing "docker run" command
$ docker run hello-world


You have successfully installed the boot2docker on windows and ready to use docker. 

Using docker from powershell or windows cmd


For using docker from powershell or CMD, we have to add the .ssh in its PATH variables and set some docker variables like DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY



Useful Resource 

NOTE:
Recently, Microsoft announces new container technology as well as nano servers for azure cloud and windows servers to run cloud applications and containers.


Share:

0 comments:

Post a Comment