mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-18 10:01:08 +00:00
Update cheatsheets
This commit is contained in:
16
tldr/docker
16
tldr/docker
@@ -11,32 +11,32 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- List all Docker containers (running and stopped):
|
||||
|
||||
`docker ps {{[-a|--all]}}`
|
||||
`docker {{[ps|container ls]}} {{[-a|--all]}}`
|
||||
|
||||
- Start a container from an image, with a custom name:
|
||||
|
||||
`docker run --name {{container_name}} {{image}}`
|
||||
`docker {{[run|container run]}} --name {{container_name}} {{image}}`
|
||||
|
||||
- Start or stop an existing container:
|
||||
|
||||
`docker {{start|stop}} {{container_name}}`
|
||||
`docker container {{start|stop}} {{container_name}}`
|
||||
|
||||
- Pull an image from a Docker registry:
|
||||
|
||||
`docker pull {{image}}`
|
||||
`docker {{[pull|image pull]}} {{image}}`
|
||||
|
||||
- Display the list of already downloaded images:
|
||||
|
||||
`docker images`
|
||||
`docker {{[images|image ls]}}`
|
||||
|
||||
- Open an interactive tty with Bourne shell (`sh`) inside a running container:
|
||||
|
||||
`docker exec {{[-it|--interactive --tty]}} {{container_name}} {{sh}}`
|
||||
`docker {{[exec|container exec]}} {{[-it|--interactive --tty]}} {{container_name}} {{sh}}`
|
||||
|
||||
- Remove stopped containers:
|
||||
|
||||
`docker rm {{container1 container2 ...}}`
|
||||
`docker {{[rm|container rm]}} {{container1 container2 ...}}`
|
||||
|
||||
- Fetch and follow the logs of a container:
|
||||
|
||||
`docker logs {{[-f|--follow]}} {{container_name}}`
|
||||
`docker {{[logs|container logs]}} {{[-f|--follow]}} {{container_name}}`
|
||||
|
||||
Reference in New Issue
Block a user