Run image

docker run -d --network=host -p 80:80 -v /var/www/html:/var/www/html image_name

 

Show and kill processes 

docker ps

docker stop 

 

Basic Tasks

docker system prune : remove unused image layers and containers

 

Image Management

docker images : list images

docker commit "container" "image:TAG" : create image from container (ps -a)

docker save "image" > "tarfile" : save image into tar file

docker load -i "tarfile" : load tar file into image depository

docker rmi "image" : remove image

docker pull "image" : pull image only and not run

docker history "image" : show history of image

Volume Management

docker volume ls : list volumes

docker volume inspect "volume" : inspect a particular volume

Container Management

docker container ls : list container, same as docker ps

docker container inspect “container” : check container network settings

docker logs “container” : inspect container log

docker container rm “container” : delete container

Runtime Tasks

Connect to Container : docker exec -it “container” bash