"""
#1、修改源命令
vim /etc/docker/daemon.json
#2、 添加源
{
{"registry-mirrors":["https://registry.docker-cn.com"],
"storage-driver":"devicemapper" #解决Job什么的报错
}
#3、重启docker服务
systemctl restart docker
"""
结合生活例子来理解镜像和容器:
镜像===》某某某.iso文件===》光盘
容器好比装光盘的VCD/DVD,电视机好比显示器。
有了容器,方便插拔,插到哪个显示器就能完美播放【运行】
redis镜像,mysql镜像,nginx镜像,django镜像,python镜像:linux+xx软件----》镜像跑起来--》容器:操作系统上运行着redis服务
[查找镜像网址](https://hub.docker.com/)
docker search helloworld
docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 5956 [OK] 是否是自动构建
# 获取镜像:
docker pull centos # 拉取最新的:相当于docker pull centos:latest
docker pull centos:centos7 # 拉取一个centos7
docker pull centos:centos6.7
docker pull centos:centos10 # 这个没有,就报错
# 查看本地镜像
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos latest 470671670cac 3 months ago 237MB
centos centos7 5e35e350aded 5 months ago 203MB
# 删除本地镜像
docker rmi 470671670cac # 通过id号删除
docker rmi centos:centos7 # 通过名字删除
# 删除所有镜像
# docker rmi `docker images -q`
相当于删除后面加一堆id号
docker rmi 470671670cac 5e35e350aded
docker换源和下载镜像
猜你喜欢
转载自blog.csdn.net/YJG7D314/article/details/105825683
今日推荐
周排行