Docker概述:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
|||
| 第4行: | 第4行: | ||
sudo sh get-docker.sh | sudo sh get-docker.sh | ||
== | ==自定义镜像== | ||
vi /etc/docker/daemon.json | vi /etc/docker/daemon.json | ||
2024年6月14日 (五) 06:29的版本
安装
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
自定义镜像
vi /etc/docker/daemon.json
{
"registry-mirrors": [
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com"
]
}
service docker restart
docker info
管理
WEB UI
使用
清理空间
查看占用
docker system df
清理
docker system prune
可以用于清理磁盘,删除关闭的容器、无用的数据卷和网络,以及dangling镜像(即无tag的镜像)
docker system prune -a
清理得更加彻底,可以将没有容器使用Docker镜像都删掉。
注意,这两个命令会把你暂时关闭的容器,以及暂时没有用到的Docker镜像都删掉
网络
查看网络
docker network ls
创建桥接网络
docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 localNet