设为首页 收藏本站
查看: 2371|回复: 1

[经验分享] Docker仓库搭建(Registry + Portus)

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-8-2 08:56:09 | 显示全部楼层 |阅读模式
1、安装CentOS 7.2(步骤略)
2、更新系统
1
yum update -y



3、安装docker-compose
1
2
3
yum -y install epel-release    #pip安装包在epel源中
yum -y install python-pip
pip install -U docker-compose



4、安装git客户端
1
yum install -y git



5、复制Portus安装程序
1
2
git clone
https://github.com/SUSE/Portus.git



6、配置Docker安装源
1
2
3
4
5
6
7
8
vi /etc/yum.repos.d/docker.repo
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=
https://yum.dockerproject.org/gpg




7、安装docker引擎并启动
1
2
3
4
yum cleal all && yum makecache
yum install -y docker-engine
systemctl start docker.service
systemctl enable docker.service




8、安装Portus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
./compose-setup.sh -e 192.168.0.109
#安装过程中会下载registry、mariadb、rails、ports_web等几个docker镜像
#如果网络不好可以先下载对应的几个docker镜像文件
#然后上传到portus服务器上并用docker load命令加载。
#镜像的具体版本号以实际为准。
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
portus_web          latest              24a654206d8b        2 days ago          1.086 GB
registry            2.3.1               83139345d017        4 months ago        165.8 MB
mariadb             10.0.23             93631b528e67        5 months ago        304.6 MB
rails               4.2.2               99b347e4bbb4        13 months ago       884.5 MB
安装过后会给出相应的登陆信息和客户端需要的操作样例
###################
#     SUCCESS     #
###################

Make sure port 3000 and 5000 are open on host 192.168.0.109

Open http://192.168.0.109:3000 with your browser and perform the following steps:

  1. Create an admin account
  2. You will be redirected to a page where you have to register the registry. In this form:
    - Choose a custom name for the registry.
    - Enter 192.168.0.109:5000 as the hostname.
    - Do *not* check the "Use SSL" checkbox, since this setup is not using SSL.

Perform the following actions on the docker hosts that need to interact with your registry:

  - Ensure the docker daemon is started with the '--insecure-registry 192.168.0.109:5000'
  - Perform the docker login.

To authenticate against your registry using the docker cli do:

  $ docker login -u <portus username> -p <password> -e <email> 192.168.0.109:5000

To push an image to the private registry:

  $ docker pull busybox
  $ docker tag busybox 192.168.0.109:5000/<username>busybox
  $ docker push 192.168.0.109:5000/<username>busybox



9、打开防火墙端口
1
2
3
firewall-cmd --zone=public  --add-port=3000/tcp --permanent
firewall-cmd --zone=public  --add-port=5000/tcp --permanent
systemctl restart firewall.service



10、Portus初始化
1
在浏览器中打开创建默认管理员用户



wKiom1efhh2jb8x4AAFyZVdUIOY434.jpg
连接到本docker仓库(也可以是其他仓库,必须是registry 2.0以上版本)
wKioL1efhjWBEWtqAABsLIPowb4301.jpg
10、上传镜像测试
修改文件/lib/systemd/system/docker.service中的ExecStart增加--insecure-registry 192.168.0.109:5000并重启docker服务
1
2
systemctl daemon-reload
systemctl restart docker.service



检查docker服务
1
2
# ps -ef|grep insecure-registry
root     29486     1  0 01:32 ?        00:00:00 /usr/bin/dockerd --insecure-registry 192.168.0.109:5000



下载busybox镜像并上传到私有的仓库中(安装结束时有操作提示)
docker pull busybox
docker tag busybox 192.168.0.109:5000/admin/busybox
docker login -u admin -p admin123 192.168.0.109:5000
docker push 192.168.0.109:5000/admin/busybox

检查Portus界面的镜像信息
QQ截图20160802085556.png
11、服务器重启后处理
应该先启动


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-251949-1-1.html 上篇帖子: 安装docker linux内核如何升级 下篇帖子: Docker的基础环境搭建 仓库
累计签到:54 天
连续签到:1 天
发表于 2016-8-2 23:02:18 | 显示全部楼层
比较符合实际情况

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表