Skip to content

Docker Deep Dive: Docker Commands

Tanveer Alam edited this page Jun 26, 2019 · 5 revisions

docker --help | more

docker container -h

docker images -h

docker images ls -h

docker image pull $image_name

docker image inspect $image_id

-P : is for port mapping, -d : is to run container in the background

docker container run -P -d nginx

docker container inspect $container_id

docker container top $container_id

docker container stop $container_id

docker container start $container_id

docker container pause $container_id

docker container unpause $container_id

docker container logs $container_id

stats - Display a live stream of container(s) resource usage statistics

$ docker container stats 1017ff810803
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
1017ff810803        loving_brattain     0.00%               2.574MiB / 15.41GiB   0.02%               11.2kB / 1.27kB     279kB / 0B          2

docker container exec -it $container_id ls /bin/bash

Remove all stopped containers

docker container prune
docker container prune -f 

____________________ Important ____________________

Container's World



Clone this wiki locally