docker: simplify examples (#2597)

This commit is contained in:
Matthew Peveler 2018-12-13 04:47:48 -05:00 committed by Starbeamrainbowlabs
parent 3448b135ec
commit 1fe90c65d6

View File

@ -4,36 +4,32 @@
- List currently running docker containers:
`docker container ls`
`docker ps`
- List all docker containers (running and stopped):
`docker container ls -a`
`docker ps -a`
- Start a container from an image, with a custom name:
`docker container run --name={{container_name}} {{image}}`
`docker run --name {{container_name}} {{image}}`
- Start or stop an existing container:
`docker container {{start|stop}} {{container_name}}`
`docker {{start|stop}} {{container_name}}`
- Pull an image from a docker registry:
`docker pull {{image}}`
- Start a container from an image and get a shell inside of it:
- Open a shell inside of an already running container:
`docker container run -it {{image}} bash`
- Run a command inside of an already running container:
`docker container exec {{container_name}} {{command}}`
`docker exec -it {{container_name}} {{sh}}`
- Remove a stopped container:
`docker container rm {{container_name}}`
`docker rm {{container_name}}`
- Fetch and follow the logs of a container:
`docker container logs -f {{container_name}}`
`docker logs -f {{container_name}}`