Pages in Docker

Docker Cheatsheet


Container vs Image Image is immutable, container is a box running starting from an image. docker ps -as # list all containers with sizes docker images # list all images docker run [options] <image> # best to use image id or image:tag # -p hostPort:containerPort expose port, -P publish all exposed ports. 8888 for jupyter notebook # -t terminal pseudo-TTY # -i Keep STDIN open even if not attached # -v /host/dir:/<container-path> # –name Assign a name to the container docker start -ai <container> # can user container id or name # -a Attach STDOUT/STDERR and forward signals # -i Attach container’s STDIN jupyter notebook –ip 0.