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
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
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
url of the repo : "https://github.com/tushar821999/Docker.git"
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
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/
Docker Hub Official Link : https://hub.docker.com/
Documentation Link : https://docs.docker.com/
LinkedIn Profile : https://www.linkedin.com/in/tushar-verma-047329154/
Komentar
Posting Komentar