Aroy-Art-Site/content/blog/docker-cheat-sheet.md

67 lines
2 KiB
Markdown
Raw Normal View History

2022-03-19 13:19:55 +00:00
---
title: Docker Cheat Sheet
2023-01-15 17:05:39 +00:00
description: This is my list of use full Docker commands.
2022-03-19 13:19:55 +00:00
date: 2020-12-02T00:00:00.000Z
lastmod: '2021-12-31T16:03:40.561Z'
image: /images/blog/Image-Docker-Command-Cheat-Sheet.png
description: This is my Docker commands cheat sheet.
tags:
2023-01-15 17:06:12 +00:00
- Cheat-Sheet
- Docker
- Command-Line
- Linux
slug: docker-cheat-sheet
2022-03-19 13:19:55 +00:00
---
# A list of docker commands
---
### List images
2023-01-15 17:17:59 +00:00
```Shell
2022-03-19 13:19:55 +00:00
docker images [OPTIONS] [REPOSITORY[:TAG]]
```
#### Options
2023-01-15 17:19:48 +00:00
| Name, shorthand | Default | Description |
| :-------------- | :------: | --------------------------------------------------- |
| `--all, -a` | | Show all images (default hides intermediate images) |
| `--digests` | | Show digests |
| `--filter, -f` | | Filter output based on conditions provided |
| `--format` | | Pretty-print images using a Go template |
| `--no-trunc` | | Dont truncate output |
| `--quiet, -q` | | Only show numeric IDs |
2022-03-19 13:19:55 +00:00
---
### Remove one or more containers
2023-01-15 17:17:59 +00:00
```Shell
2022-03-19 13:19:55 +00:00
docker rm [OPTIONS] CONTAINER [CONTAINER...]
```
#### Options
| Name, shorthand | Default | Description |
2023-01-15 17:19:48 +00:00
|:----------------|:-------:| ------------------------------------------------------- |
|`--force, -f` | | Force the removal of a running container (uses SIGKILL) |
|`--link, -l` | | Remove the specified link |
|`--volumes, -v` | | Remove anonymous volumes associated with the container |
2022-03-19 13:19:55 +00:00
---
### Stop one or more running containers
2023-01-15 17:17:59 +00:00
```Shell
2022-03-19 13:19:55 +00:00
docker stop [OPTIONS] CONTAINER [CONTAINER...]
```
#### Options
| Name, shorthand | Default | Description |
|:----------------|:-------:| ------------------------------------------- |
|`--time , -t` | 10 | Seconds to wait for stop before killing it. |