diff --git a/Cheatsheets/docker.md b/Cheatsheets/docker.md index 65a9d37..979d935 100644 --- a/Cheatsheets/docker.md +++ b/Cheatsheets/docker.md @@ -103,7 +103,7 @@ Using this command results in a random Image ID that you use to run a container. ### Assign a Name:Tag to the image -Assign a name and tag to the image because you are a responsible dev. +Assign a name and tag to the image because you are not a barbarian. `docker build -t name:tag .` @@ -159,15 +159,22 @@ Parameters for running a container ### List all containers (running and not running) `docker ps -a` -### Stop a container +### Stop a container `docker stop {containername}` +### Start a stopped container +`docker start {containername}` + ### Remove a stopped container `docker rm {containername}` ### Remove ALL stopped containers `docker container prune` +### Attach to a running container +Use this if you are running in detached mode and need to attach to see content logged to the console. +`docker attach {comtainername}` + ## Volumes Volumes store persistent data that survives after a container shuts down. These are folders on the host machine that are mounted in the container.