Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Containers are packages of software that contain all of the necessary elements to

run an application in any environment.

Docker is a containerization platform that packages your application and all its
dependencies together in the form of a docker container to ensure that your
application works seamlessly in any environment.

Docker Container is a standardized unit which can be created on the fly to deploy a
particular application or environment

Docker:

docker search hello-world - to search images in CLI


docker pull hello-world - to download the images
docker image ls - to check the current images installed
doker rmi imagename - to delete the image
docker run hello-world - to run the image(it will create a container based on the
image)
doker run -d hello-world - to run container in the background
docker rm hello-world - to remove the container
docker ps -a - to check the running containers
docker run alpine ls - to run a particular command in a container
docker run -t alpine sh - to run a container interactively
docker start containerid - to start a conatiner a container again
docker stop containerid - to stop a conatiner
docker exec -it container id - to run a container interactively
docker inspect --format='{{.NetworkSettings.IPAddress}}' ee735940c932 - To get the
ip address of the running container
docker cp dockerfile c31b3eb98ad6:/test

docker run -d -p 172.18.0.61:80:80 nginx

192.168.1.16 - private
182.65.228.152 - public
2401:4900:1cd1:3594:f064:da6b:7cf9:818e - public

You might also like