Docker 本地仓库搭建及http不能访问的解决方式

本文介绍如何搭建Docker本地仓库并解决HTTP访问问题。主要内容包括:下载仓库镜像、配置不安全注册表、运行本地仓库、推送和拉取镜像等步骤。

Docker 本地仓库搭建及http不能访问的解决方式

Docker安装省略


下载仓库镜像

docker pull registry

解决http不能访问(用到这个仓库的机器都要执行这个操作)

touch /etc/docker/daemon.json

可以设多个ip,我后面设了一个对外的IP

echo '{ "insecure-registries":["192.168.20.57:5000","xxx.xxx.xxx.xxx:5000"] }' >  /etc/docker/daemon.json

启动

docker run -d -p 5000:5000 --restart=always -v /opt/registry-var/:/var/lib/registry/  registry

测试

docker tag hello-world 192.168.20.57:5000/hello

上传到本地仓库

docker push 192.168.20.57:5000/hello

下载

docker pull 192.168.20.57:5000/hello

查看

curl http://192.168.20.57:5000/v2/_catalog

查看镜像tag
http://192.168.20.57:5000/v2/hello/tags/list  
暂时还不能删除
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值