This is a draft cheat sheet. It is a work in progress and is not finished yet.
Docker Daemon
sudo systemctl start docker
|
Start Docker Daemon |
sudo systemctl stop docker
|
Stop Docker Daemon |
sudo systemctl restart docker
|
Restart Docker Daemon |
sudo systemctl status docker
|
Check if Docker Daemon is running |
If you do not have systemctl, use the service command " sudo service docker [start|stop|status|restart]
"
Docker Common Command Line
|
Show docker client and server version |
|
Show docker server information |
|
List of installed docker images |
|
Resource Utilication Monitoring |
docker ps [-a] docker container ls
|
List of containers Option -a: all container |
Running container
nvidia-docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...]
|
Run container from a given image |
Options |
--name |
container name |
-i |
Interactive session |
-t |
terminal TTY |
--rm |
remove when exited |
-p H:C |
Exposes the port C of the container to the port H of the host |
-P |
expose all port |
-v H:C |
Mount the host path H at the path C in the container |
-w |
set working directory in container |
-m |
memory limit |
--cpuset-cpus |
limit cpus to run |
--add-host |
custom host:ip setting |
--privileged |
open kernal functions |
Enables GPU selection (with NV_GPU option) |
NV_GPU=1,3 nvidia-docker run --rm nvidia/caffe nvidia-smi
|
Multi GPU Selection Select with GPU Topology with NVLINK |
nvidia-docker run --rm nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04 nvidia-smi topo -m
|
Managing Container
docker logs {CONTAINERNAME}
|
Get the logs of the container |
docker kill {CONTAINERNAME}
|
Kill the container |
docker inspect {CONTAINERNAME}
|
Inspect the details of a container |
docker start {CONTAINERNAME}
|
start container |
docker stop {CONTAINERNAME}
|
stop container |
docker rm [-f] {CONTAINERNAME}
|
Remove the container Option: -f: Force removal of the container |
docker rm $(docker ps -a -f status=exited -q)
|
Removing all exited containers |
docker rm `docker ps - a -q`
|
Removing all stopped containers |
Managing Image
docker search {IMAGENAME}
|
Search image |
|
Pull an image |
|
Remove image |
docker rmi $(docker images -a -q)
|
Remove all imges |
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)
|
Stop and Remove all image |
NVIDIA Docker Repository
|
Login to a Repository Username: $oauthtoken Password: {API Token} |
|
Logout |
|