1. 将默认的配置文件复制出来
cp -n /lib/systemd/system/docker.service /etc/systemd/system/docker.service
2. 将加速器地址添加到配置文件的启动命令
sudo sed -i "s|ExecStart=/usr/bin/docker daemon|ExecStart=/usr/bin/docker daemon --registry- mirror=https://gbpursha.mirror.aliyuncs.com|g" /etc/systemd/system/docker.service
sudo systemctl daemon-reload
3. 重启Docker
sudo service docker restart
原文地址:https://www.cnblogs.com/shaohsiung/p/9642183.html
时间: 2024-10-04 08:01:46