yum install docker
docker -v
systemctl start docker
docker ps -- running processes/containers in docker
docker ps -a ---- shows all the containers.
docker images -- shows all the images
docker image ls -- show all the images
docker pull imagename ---- imagename can be taken from dockerhub
docker run imagename --- already downloaded image will be run or it else it will
downloaded
docker rmi -f imagename --- deletes the image
docker image --help, docker --help
docker run -it imagename COMMAND -- here the commands which we provide executes
docker run -it ubuntu:18.04 ps -ef -- runs ps -ef command in the containers
docker run -it ubuntu:18.04 bash
whenever we use docker run a new container is launched.
docker container ls / docker ps
docker stats containerID --- memory/cpu usage of the container.
ctrl+d === exits the container and stops it
ctrl p+q == exists the container but doesnt stops
login to a running container:
docker exec -it containerID bash
to stop the running containers:-
docker container stop containerID
docker container start containerID
docker system prune -a -f