Step: Installation: Docker Introduction Docker Installation Linux
Step: Installation: Docker Introduction Docker Installation Linux
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
Docker:
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