All commands might need to add
sudo in front.
General commands:
-
list the Docker version installed docker version
-
docker info
-
docker or docker help
Images-related commands
(An image is a combination of a file system and parameters):
-
docker pull <REPOSITORY>:<TAG>,
where :<TAG> could be ommited if latest
-
<REPOSITORY>:<TAG>
is then equivalent to <ImageID>
-
list all images (or only Image ID's) docker images (-p)
-
list the details of an image docker inspect <REPOSITORY>:<TAG>
-
docker run <REPOSITORY>:<TAG>,
or in interactive mode docker run -it <REPOSITORY>:<TAG> /bin/bash,
or map the ports by docker run -p <port>:<port> <REPOSITORY>:<TAG>
this will pull the docker first if not yet
-
list all commands that were run with the image via a container docker history <ImageID>
-
remove an image docker rmi <ImageID>
Containers-related commands
(Containers are instances of Docker images that can be run using the Docker run command):
-
<ContainerName>
is equivalent to <ContainerID>
-
list all running (or all) containers docker ps (-a)
-
list top-level processes within the container docker top <ContainerID>
-
show the statistics (CPU and memory utilization) of a running container docker stats <ContainerID>
-
list the details of a container docker inspect <ContainerID>
-
docker attach <ContainerID> and
docker exec -it <ContainerName> /bin/bash
-
docker start <ContainerID> and
docker stop <ContainerID>
-
docker pause <ContainerID> and
docker unpause <ContainerID>
-
docker kill <ContainerID> and
docker rm <ContainerID>
Architectures of Virtual Machines vs. Dockers:
-
vs.
References: