Files
Obsidian-Main/00. Inbox/Linux/Docker.md

39 lines
721 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 安裝
根據[Install Docker Engine on Debian](https://docs.docker.com/engine/install/debian/)來安裝Docker engine。
# 指令
## 列出可用的版本
```bash
# List the available versions:
apt-cache madison docker-ce | awk '{ print $3 }'
5:24.0.0-1~debian.11~bullseye
5:23.0.6-1~debian.11~bullseye
...
```
## Container 相關
### 列出 container
`docker ps`會列出執行中的container但是停止的不會
```bash
sudo docker ps
```
如果也要列出已停止的container
```bash
sudo docker ps -a
```
### 刪除 container
Container必須是停止狀態才可以刪除
```bash
sudo docker rm <CONTAINER_ID>
```
## Image 相關
### 列出 image
```bash
sudo docker image ls
or
sudo docker images
```