Basic Docker Notes
Create and run a new container from an image 1 docker container run -it --rm ubuntu /bin/bash -i or --interactive: Keep STDIN open even if not attached -t or --tty: Allocate a pseudo-TTY --rm: Automatically remove the container when it exits --name: Assign a name to the container -d or --detach: Run container in background and print container ID Aliases: docker container run, docker run
List containers 1 docker container ps -a -a or --all: Show all containers (default shows just running) Aliases: docker container ls, docker container list, docker container ps, docker ps