mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-17 15:49:34 +00:00
Update cheatsheets
This commit is contained in:
42
docker
Normal file
42
docker
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# docker
|
||||
|
||||
> Manage Docker containers and images.
|
||||
> Some subcommands such as `docker run` have their own usage documentation.
|
||||
> More information: <https://docs.docker.com/engine/reference/commandline/cli/>.
|
||||
|
||||
- List all docker containers (running and stopped):
|
||||
|
||||
`docker ps --all`
|
||||
|
||||
- Start a container from an image, with a custom name:
|
||||
|
||||
`docker run --name {{container_name}} {{image}}`
|
||||
|
||||
- Start or stop an existing container:
|
||||
|
||||
`docker {{start|stop}} {{container_name}}`
|
||||
|
||||
- Pull an image from a docker registry:
|
||||
|
||||
`docker pull {{image}}`
|
||||
|
||||
- Display the list of already downloaded images:
|
||||
|
||||
`docker images`
|
||||
|
||||
- Open a shell inside a running container:
|
||||
|
||||
`docker exec -it {{container_name}} {{sh}}`
|
||||
|
||||
- Remove a stopped container:
|
||||
|
||||
`docker rm {{container_name}}`
|
||||
|
||||
- Fetch and follow the logs of a container:
|
||||
|
||||
`docker logs -f {{container_name}}`
|
||||
Reference in New Issue
Block a user