鸿 网 互 联 www.68idc.cn

Dokcer创建私有仓库、私有仓库Web管理推荐

来源:互联网 作者:佚名 时间:2018-01-22 10:04
1、直接用Docker提供的镜像registry运行私有仓库 # docker run -d -p 5000:5000 -v /data/registry:/var/lib/registry --name registry --restart='always' registry -v : 挂载宿主机目录到容器中作为数据卷, docker registry上传镜像默认存放到容器/var/li

1、直接用Docker提供的镜像registry运行私有仓库

# docker run -d -p 5000:5000 -v /data/registry:/var/lib/registry --name registry --restart='always' registry

-v : 挂载宿主机目录到容器中作为数据卷, docker registry上传镜像默认存放到容器/var/lib/registry,将本地/data/registry目录挂载到容器中,避免删除容器是数据丢失

--name : 容器名称,不配置将随机生成

--restart: 重启策略,这里配置为always为任何时候

 

2、查看仓库是否正常


# curl -XGET http://192.168.62.200:5000/v2/_catalog
{ repositories :[ saltruler_web , ubuntu ]}

saltops v3 f86ee612af8f 20 minutes ago 580 MB saltops v2 f851c8406430 5 hours ago 580 MB saltops latest b8246781274a 6 hours ago 509 MB centos/resin 3.1.8 24b506c6b19a 4 days ago 450 MB 192.168.62.200:5000/saltruler_web latest a2e9e9205aea 4 days ago 966 MB saltruler_web latest a2e9e9205aea 4 days ago 966 MB djangotest_web latest 3c00ad940197 5 days ago 722 MB mysql latest 9546ca122d3a 11 days ago 407 MB python 3.4 c588c14f484e 2 weeks ago 684 MB python 2.7 68caceba17ab 2 weeks ago 677 MB postgres latest 9910dc9f2ac0 2 weeks ago 267 MB centos latest 98d35105a391 3 weeks ago 192 MB mycentos latest 98d35105a391 3 weeks ago 192 MB jdeathe/centos-ssh-apache-php latest c2ae3c97feb1 4 weeks ago 284 MB registry 2 047218491f8c 5 weeks ago 33.2 MB registry latest 047218491f8c 5 weeks ago 33.2 MB redis latest e4a35914679d 5 weeks ago 183 MB nginx latest 6b914bbcb89e 5 weeks ago 182 MB registry 2.1.1 52bb991b482e 17 months ago 220 MB
REPOSITORY TAG IMAGE ID CREATED SIZE 192.168.62.200:5000/saltops v3 f86ee612af8f 22 minutes ago 580 MB saltops v3 f86ee612af8f 22 minutes ago 580 MB saltops v2 f851c8406430 5 hours ago 580 MB saltops latest b8246781274a 6 hours ago 509 MB centos/resin 3.1.8 24b506c6b19a 4 days ago 450 MB 192.168.62.200:5000/saltruler_web latest a2e9e9205aea 4 days ago 966 MB saltruler_web latest a2e9e9205aea 4 days ago 966 MB djangotest_web latest 3c00ad940197 5 days ago 722 MB mysql latest 9546ca122d3a 11 days ago 407 MB python 3.4 c588c14f484e 2 weeks ago 684 MB python 2.7 68caceba17ab 2 weeks ago 677 MB postgres latest 9910dc9f2ac0 2 weeks ago 267 MB mycentos latest 98d35105a391 3 weeks ago 192 MB centos latest 98d35105a391 3 weeks ago 192 MB jdeathe/centos-ssh-apache-php latest c2ae3c97feb1 4 weeks ago 284 MB registry 2 047218491f8c 5 weeks ago 33.2 MB registry latest 047218491f8c 5 weeks ago 33.2 MB redis latest e4a35914679d 5 weeks ago 183 MB nginx latest 6b914bbcb89e 5 weeks ago 182 MB registry 2.1.1 52bb991b482e 17 months ago 220 MB
# docker push 192.168.62.200:5000/saltops:v3
The push refers to a repository [192.168.62.200:5000/saltops]
d8d7b4725725: Pushed 
81e97be478f1: Pushed 
f245be9edb71: Pushed 
9b198ff9ff5b: Pushed 
v3: digest: sha256:4a7c610dbeab40a25486b6d8eb7b98bc95c585d1c3fc1f99c34a06348eea0c19 size: 1162

# curl -XGET http://192.168.62.200:5000/v2/saltops/tags/list
{ name : saltops , tags :[ v3 ]}

yum install -y gcc gcc-c++ python-devel pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
tcp 0 0 0.0.0.0:10210 0.0.0.0:* LISTEN 33787/Breezes tcp6 0 0 :::10210 :::* LISTEN 33787/Breezes
网友评论
<