Docker Tutorial : Play With Containers/Images

What we learn ?

1. What is Docker/Containers/Images
2. Some Basic Docker Command
3. How to Run Alpine Docker Container
4. How to Run Ubuntu/Centos images
5. Fetch Random Quotes From talaikis api
6. Pull Python Enviroment and Run Python file from Github
7. Run Flask Application



What is Docker ? 

Docker is a container management service. The keywords of Docker are develop, ship and run anywhere. The whole idea of Docker is for developers to easily develop applications, ship them into containers which can then be deployed anywhere 

What is Containers ?

Docker container is an open source software development platform. Its main benefit is to package applications in “containers,” allowing them to be portable among any system running the Linux operating system (OS).
What is images ?

An image is an inert, immutable, file that's essentially a snapshot of a container. Images are created with the build command, and they'll produce a container when started with run. Images are stored in a Docker registry such as registry.hub.docker.com 

Features of Docker ? 

1. Docker has the ability to reduce the size of the development by providing a smaller footprint of the operating system via containers.
2. With containers, it becomes easier for teams across different units, such as development, QA and Operations to work seamlessly across applications. 
3. You can deploy docker containers anywhere, on any physical and virtual machines and even on the cloud
4. Since docker containers are pretty lightweight, they are very easily scalable

Let's get started with Docker hand's on 

1. Setup Playing Environment with Docker

For now you just setup a new instance on virtual online enviroment provided by Docker itself just visit play-with-docker.com  and login with your docker account if you are new just visit hub.docker.com and register yourself after succesfully login you will see this window


Now in the side bar click on "Add New Instance"

Congratulation,You successfully setup playing environment with docker 

 2. Some Basic Docker Commands
 A. Checking Version
  This Command is used for check the current version of the Docker environment
  
 B. Run Hello World
This Command first check the hello world image locally if the image is not found it pick up image from the docker hub 

C. Checking Docker info
This Command shows current info of the Docker like existing containers and images and active/inactive status of services

D. Checking Images
This Command shows existing images in the docker 

3. Run Alpine Docker Container

This Command run the alpine docker container


4. Run Ubuntu/Centos images
This command is used to run the interactive terminal of ubuntu . here -it means -i (interactive) and -t (terminal) and --name this flag is used to give name to the ubuntu images and to get exit from this ubuntu image simply type "exit" or press "ctrl+p+q"
Creating centos image
This command is used to run the interactive terminal of centos and here -it means interactive terminal and image name centos and if you want to exit from this image simply type exit

5. Fetch Random Quotes From talaikis api
script
command
output123
 
6.Pull Python Enviroment and Run Python file from Github
A. Clone the "Docker" name github repo by using this command



B. Pull the python from docker hub in docker container using this command


C. Change current directory to the cloned github docker repo


D. Check python is successfully pulled or not by checking its version


E.  Finally run the .py file


7. Run Flask Application

This is the Example of Running Flask Application you can clone repo using this url
https://github.com/tushar821999/Flask_Registration_App.git

All the steps are same as previous one here is the only one new step which is that you have to install the required module name "Flask" which is required by flask application for installing this module use this command


  
Posted By : Tushar Verma 
Docker Hub Official Link : https://hub.docker.com/
Documentation Link : https://docs.docker.com/
LinkedIn Profile  : https://www.linkedin.com/in/tushar-verma-047329154/

7 Comments

  1. Good content help full for me.

    ReplyDelete
  2. The information you shared was useful. Thank you for taking the time to organize it. blockchain development company has altered pretty radically over the last couple of years. What happening as a means to power up an efficient payment network has transformed into a reorganized processer where developers from all everywhere the world can come and create their own software applications. ADe Technologies offers blockchain development service in an efficient way. Please feel free to call us on +1 800-912-1219 or contact by email (contact@ade-technologies.com), if you require any additional information. Please visit our website www.ade-technologies.com

    ReplyDelete
  3. The information you shared was useful. Thank you for taking the time to organize it. blockchain development company has altered pretty radically over the last couple of years. What happening as a means to power up an efficient payment network has transformed into a reorganized processer where developers from all everywhere the world can come and create their own software applications. ADe Technologies offers blockchain development service in an efficient way. Please feel free to call us on +1 800-912-1219 or contact by email (contact@ade-technologies.com), if you require any additional information. Please visit our website www.ade-technologies.com

    ReplyDelete
  4. Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..
    DevOps Online Training institute
    DevOps Online Training in Hyderabad

    ReplyDelete
  5. Very impressive and interesting blogReally I Appreciate The Effort You Made To Share The Knowledge. This Is Really A Great Stuff For Sharing. Keep It Up . Thanks For Sharing
    DevOps Training in Chennai

    DevOps Online Training in Chennai

    DevOps Training in Bangalore

    DevOps Training in Hyderabad

    DevOps Training in Coimbatore

    DevOps Training

    DevOps Online Training

    ReplyDelete

Post a comment

Previous Post Next Post