Thursday, August 30, 2018

How to install Docker in Windows Machine

Docker:-
Docker is the most revolutionized technology in virtualization world nowadays. Docker is actually an open source project which provides container technology. A container is a lightweight VM(virtual machine) or a process which allows us to install Linux based applications inside it. The container doesn’t have its own Kernel, RAM, CPU and Disk but it uses the underlying OS kernel, RAM, CPU cores and Disk.
Step 1- Download docker for windows installer file.
Download docker for windows installer file from its official download link- click on the link below or copy paste to your browser.
https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
Step 2- Start installation:
Run the installer file and follow the steps below to complete the installation.

After download complete, select the add shortcut to the desktop and click on OK button. This is default installation, we will discuss about Windows container in our next blog.

Once you click on Ok, It will start the installation of Docker.
After successful installation, you will get this page and click on close and log out (It will log off your computerto finish the installation. After this, your docker will be ready to use.
Relogin your computer to start working with Docker for Windows.

Step 3- Initial setup configuration:
Click on the desktop shortcut icon Docker for Windows,  It will start docker 

During the docker start process, you may get a message -Hyper-v and Container features are not enabled. In this case, click on OK to finish the features installation process.
The above process may take some time and it will reboot your computer to finish the features installation. After a reboot of your computer, Docker will start auto and you will get this message.
Now, your docker is ready to use
Step 4- Some basic and useful commands.
Now, we can operate our docker using Powershell, lets have a look at some basic commands.
Open Windows Powershell: Run > PowerShell > press Enter
RUN > Powershell > Press Enter
4A-Check Docker version:
docker version
4B-Search Ubuntu Docker image using Search command.
docker search ubuntu
4C- Pull docker image
docker pull ubuntu
4D-  Create First Container using Image - Ubuntu
Create your first container using below command.
docker run -dit --name container1 ubuntu
Check running container 
docker ps
4E-  Access container console
To access your container use below command.
docker attach Container_ID
you can use all the Linux commands to operate your Linux container.
4F-To exit from the container press the combination of these keys:
ctrl+p+q
The combinations of the above command will exit you from the container's console without stopping it. If you are going type Exit it will stop your container.
4G- Stop container.
Change your container's name in the below command
docker stop container_name
4H- Start container.
Change your container's name in the below command
docker start container_name
4I- List all stop and running container.
This command will list all the container
docker ps -a

Thanks for reading my blog, please comments to make this blog better.

No comments:

Post a Comment