Docker概述
安装 编辑
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
使用cloudflare代理 编辑
https://github.com/cmliu/CF-Workers-docker.io?tab=readme-ov-file
管理 编辑
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