Docker配置使用harbor私服

Docker默认使用docker-hub拉取镜像,使用harbor私服,必须对docker进行配置,否则docker在拉取镜像时会报错

1. 添加harbor私服配置

创建或修改以下文件:

vim /etc/docker/daemon.json

添加或增加harbor配置:

{ "insecure-registries":["myhostname"] }
2. 登录harbor
docker login -u admin -p Harbor12345 yourhostname

登录完成后会在docker配置中增加一条授权记录

cat /root/.docker/config.json

Leave a Reply

Your email address will not be published. Required fields are marked *