mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://uoggbpok.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
或者:
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://68rmyzg7.mirror.aliyuncs.com"]
}
```
#3. Doocker 体系结构

# 4. Docker 的镜像基础管理
## 4.1 获取镜像
```
基础镜像拉取
docker search centos
docker pull centos:6.9
docker pull centos:7.5.1804
docker pull nginx
```
## 4.2 镜像基本查看
```
[root@docker ~]# docker image ls
REPOSITORY TAG IMAGE ID CREATED
SIZE
centos 6.8 82f3b5f3c58f 4 months ago
195 MB
centos 6.9 2199b8eb8390 4 months ago
195 MB
centos 7.5.1804 cf49811e3cdb 4 months ago
200 MB
centos 7.6.1810 f1cb7c7d58b7 4 months ago
202 MB
oldguo/centos_sshd v1.0
oldguo/centos_sshd v2.0
oldguo/centos_sshd v3.0
标识镜像唯一性的方法:
1. REPOSITORY:TAG
centos:7.5.1804
2. IMAGE ID (sha256:64 位的号码,默认只截取 12 位)
82f3b5f3c58
[root@docker /]# docker image ls --no-trunc
```
## 4.3 镜像详细信息查看
```
[root@docker /]# docker image inspect ubuntu:latest
[root@docker /]# docker image inspect 82f3b5f3c58f
```
评论