私有仓库搭建

来源:互联网 发布:淘宝助理初始化卡死 编辑:程序博客网 时间:2024/06/05 01:09
--启动仓库镜像,没有会下载,将仓库地址映射到本地/home/jihuan/registry-conf
sudo docker run -d -p 5000:5000 -v /home/jihuan/registry-conf:/registry-conf -e DOCKER_REGISTRY_CONFIG=/registry-conf/config.yml registry


修改Docker配置文件
vim /etc/default/docker
增加以下一行
DOCKER_OPTS="$DOCKER_OPTS --insecure-registry=192.168.2.200:5000"
重启Docker
sudo service docker restart


或者用命令启动
sudo nohup docker --insecure-registry 192.168.2.200:5000 -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock -d &


标记镜像
sudo docker tag imageID 192.168.2.200:5000/ubuntu:1404


上传镜像
sudo docker push 192.168.2.200:5000/ubuntu:1404


搜索镜像
curl http://192.168.2.200:5000/v1/search


下载镜像
sudo docker pull 192.168.2.200:5000/ubuntu:1404


批量上传
wget https://github.com/yeasy/docker_practice/raw/master/_local/push_images.sh
sudo chmod a+x push_images.sh
./push_images.sh ubuntu:latest centos:centos7
0 0
原创粉丝点击