更换docker的国内镜像源,可以加快镜像的下载。
1、在/etc/docker/下修改(如有)或创建daemon.json文件
nano /etc/docker/daemon.json
2、把以下内容复制进去:
{
"registry-mirrors": [
"https://registry.hub.docker.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com"
]
}
3、重启docker
systemctl restart docker
4、查看是否更换成功文章来源:https://www.toymoban.com/news/detail-823143.html
docker info
显示如下:文章来源地址https://www.toymoban.com/news/detail-823143.html
root@armbian:~# docker info
Client: Docker Engine - Community
Version: 24.0.4
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.19.1
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 2
Running: 2
Paused: 0
Stopped: 0
Images: 5
Server Version: 24.0.4
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc version: v1.1.7-0-g860f061
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.39-ophub
Operating System: Armbian 23.08.0-trunk bullseye
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 1.886GiB
Name: armbian
ID: d6e93fbb-6ea4-4949-9afc-d0dad983f69b
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Registry Mirrors:
https://registry.hub.docker.com/
http://hub-mirror.c.163.com/
https://docker.mirrors.ustc.edu.cn/
https://registry.docker-cn.com/
Live Restore Enabled: false
到了这里,关于docker更换国内源加速的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!