Skip to content

Commit 7a9f73c

Browse files
committed
更新容器说明
1 parent a7bb99b commit 7a9f73c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Docker.md

+30
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ $ curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sudo sh -s http://1
2424

2525
参考:https://docs.docker.com/engine/installation/
2626

27+
入门:http://tuxknight-notes.readthedocs.io/en/latest/docker/docker_command.html
28+
29+
笔记:https://blog.phpgao.com/docker-note1.html#%E6%9E%84%E5%BB%BA%E9%95%9C%E5%83%8F
30+
2731
```
2832
$ curl -sSL https://get.daocloud.io/docker | sh
2933
```
@@ -209,3 +213,29 @@ accbcfa5e2e6 hello-world "/hello" 15 hours ago
209213
$ sudo docker rm angry_bhabha
210214
```
211215

216+
删除镜像
217+
```
218+
$ sudo docker rmi hello-world
219+
```
220+
221+
删除所有正在运行的容器
222+
```
223+
$ sudo docker kill $(docker ps -a -q)
224+
```
225+
226+
删除所有已经停止的容器
227+
```
228+
$ sudo docker rm $(docker ps -a -q)
229+
```
230+
231+
删除所有镜像
232+
```
233+
$ sudo docker rmi $(docker images -q)
234+
```
235+
236+
构建镜像
237+
```
238+
sudo docker build --rm=true -t zh/redis .
239+
240+
sudo docker build --rm=true -t zh/redis -f redis.dockerfile
241+
```

0 commit comments

Comments
 (0)