美文网首页
centos7下配置使用Docker私有镜像仓库

centos7下配置使用Docker私有镜像仓库

作者: 沉思的雨季 | 来源:发表于2020-04-23 16:44 被阅读0次

一、前提条件

1、docker私有仓库配置完成,地址http://registry.tpri.com.cn:8080
2、centos7上已安装docker服务,参照CentOS7下安装Docker

二、docker私有仓库配置

1、编辑vi /etc/docker/daemon.json添加镜像加速器配置

代码示例:

{
    "registry-mirrors": ["http://hub-mirror.c.163.com"],
}

注:添加网易docker镜像源,加速公共镜像下载速度。

2、编辑vi /etc/docker/daemon.json添加私有镜像仓库配置

代码示例:

{
    "registry-mirrors": ["http://hub-mirror.c.163.com"],
    "insecure-registries": ["registry.tpri.com.cn:8080"]
}

注:registry.tpri.com.cn:8080为私有仓库域名地址和端口。

3、重启docker服务,使配置生效

#systemctl daemon-reload
#systemctl restart docker.service
#systemctl enable docker.service

4、连接docker私有仓库,测试能否访问

运行docker login registry.tpri.com.cn:8080,输入docker镜像仓库登录用户名和密码。连接成功表示配置正确,下次推送镜像可直接执行“docker push registry.tpri.com.cn:8080/用户名/镜像名:版本号”推送镜像到私有仓库。

相关文章

网友评论

      本文标题:centos7下配置使用Docker私有镜像仓库

      本文链接:https://www.haomeiwen.com/subject/bqeaihtx.html