0% found this document useful (0 votes)
64 views4 pages

Step: Installation: Docker Introduction Docker Installation Linux

Docker allows deploying and running applications using containers. It contains all the packages, libraries, and dependencies needed to run an application. The key components are: 1. Docker files define the steps to create a Docker image. Images contain the application requirements. 2. Docker images are used as templates to create containers. Images are stored in Docker Hub. 3. Docker containers are the run-time environments that run the application. Containers are created after pulling images and running them.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views4 pages

Step: Installation: Docker Introduction Docker Installation Linux

Docker allows deploying and running applications using containers. It contains all the packages, libraries, and dependencies needed to run an application. The key components are: 1. Docker files define the steps to create a Docker image. Images contain the application requirements. 2. Docker images are used as templates to create containers. Images are stored in Docker Hub. 3. Docker containers are the run-time environments that run the application. Containers are created after pulling images and running them.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

DOCKER INTRODUCTION

Docker Installation Linux:


Step: Installation
Commands:
Login as : sudo su
rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-
8.noarch.rpm

yum update -y
yum -y install docker-io
Docker Start: sudo service Docker start
Docker Stop: Sudo service Docker stop
Docker Status: Sudo service Docker status
Docker uninstall: Sudo yum remove Docker
Note: use sudo when you are not in Root User.
To see the Images: docker images
docker ps –a
docker ps

To pull the images: docker pull image


Note: here Image means Jenkins or sonar or artifactory or required
Software.

To run images: Docker run –it image id

Docker:

Docker is a tool by using this we can deploy and run applications by


using containers.
Containers contains the packages and related libraries, dependencies and
databases to up an application. and Docker will take care to allow all platforms
and work every system.

Docker Working:

Developer -> Docker File -> Docker Image -> Docker Container -> Application
Docker File: it contains the steps to create a Docker image. it’s like a recipe
with ingredient steps necessary making your dish.
Docker Images:
* Docker images are templates used to create Docker containers
* Images are stored in Docker Hub.
* it contains the requirements of our application.
Ex: libraries, dependencies, Database and Components…etc.
* if you need to download image CMD: Docker pull image-name
* if you need install images with particular Tag versions follow the
below command
CMD: Docker pull imagename:Tagversion-Number
Ex: Docker pull Ubuntu:18.04 (here it will download Ubunu 18.04
version)
*Docker image -q (it will show the Image id’s only)
*Docker run –it image-name (it will run i=interactive, t=terminal modes)
* Docker run - -name required-name -it image (we can pass name to
container)
* Docker inspect image-name (it will provide more layers and file
systems of the image)

Docker Container:
*it is a run time environment it contains the Application dependencies.
* before getting the container we have to run the images.
*Docker ps (list of all containers)
*Docker start/stop (to start/stop the Container) Ex: Docker start Container-id,
Docker stop Container id
*Docker run –name required-name –it image-name (here –it =interactive &
Terminal)
*Docker pause container-name or container id (to pause the container)
*Docker un-pause Container-name or Container id (to un-pause the Container)
*Docker top Container-id (to see the details like memory usage and input and
output)
*Docker Stats container-id (to see the some more feature compare to top
command)
*Docker attach Container-name (to attach the any required things for the
running container EX: I have to install or add any files for my
feature purpose so I am using this command)
* once if we use exit from container it won’t run and if you want to kill any
container before it have need in running stage.
* Docker kill Container-id (it will kill the container and it will come out from
container)
*Docker rm container-id (to remove the container)
* To remove all stopped containers at a time “docker rm $(docker ps -a -q) “
Note: RM- to remove the Docker container
RMI- to remove the Docker Image

Docker Containers VS Virtualization:

* ***Docker Engine: Docker Client + Docker Server (Docker Daemon).


The Docker server(daemon) receives a commands from Docker Client through
CLI or restAPI,s.
Docker Basic Commands:
Basic: 1. Docker Version: it will give information client & Engine
2. Docker –v: it will show version
3. Docker info: it will shows more information like plugins,proxys etc..
4. Docker - -help: to get the list of all commands in docker
EX: Docker images –help: we can get all commands related options to
Docker images.
5. Docker login: to login into your Docker Hub to pull/push the images.
6. Docker images: list of all images
7. Docker pull imagename: it will download images from DockerHub
8. Docker rmi imagename: it will remove required image.
9. Docker ps or Docker ps –a: this is for running containers.
10. Docker run imagename: to run the required image.
11. Docker start/stop: to start or stop the container
Ex : Docker start Container-id or Docker stop Container-id.
12. System: Docker stats
13. Docker system df : it show the memory status of devices.
14. Docker system prune

You might also like