0% found this document useful (0 votes)
17 views1 page

Essential Docker Commands Guide

The document provides instructions for installing and using the Docker container platform on a Linux system. It explains how to install Docker, check the Docker version, start the Docker service, pull images from Docker Hub, run containers from images, remove images, view running and stopped containers, view container stats, stop and start containers, login to running containers, and remove unused containers and images.

Uploaded by

saket1291997
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Essential Docker Commands Guide

The document provides instructions for installing and using the Docker container platform on a Linux system. It explains how to install Docker, check the Docker version, start the Docker service, pull images from Docker Hub, run containers from images, remove images, view running and stopped containers, view container stats, stop and start containers, login to running containers, and remove unused containers and images.

Uploaded by

saket1291997
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

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

You might also like