Browse Source

more docker notes

main
Ken Schaefer 2 years ago
parent
commit
58f5130758
  1. 9
      Cheatsheets/docker.md

9
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 .`
@ -162,12 +162,19 @@ Parameters for running 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.

Loading…
Cancel
Save