十四、docker企业级镜像仓库harbor

容器管理

[root@docker01 harbor]# pwd
/opt/harbor
[root@docker01 harbor]# docker-compose stop

1、安装docker、docker-compose

下载 harbor

cd /opt && https://storage.googleapis.com/harbor-releases/harbor-offline-installer-v1.3.0.tgz
tar xf harbor-offline-installer-v1.3.0.tgz

2、修改主机及web界面密码

[root@docker01 harbor]# vim harbor.cfg 
    ···
    hostname = 10.0.0.100
    harbor_admin_password = Harbor12345
    ···

3、执行安装脚本

root@docker01 harbor]# ./install.sh

浏览器访问 http://10.0.0.11

添加一个项目

4、镜像推送到仓库的指定项目

[root@docker02 ~]# docker  tag centos:6.8  10.0.0.100/xcn/centos6.8:1.0
[root@docker02 ~]#  
[root@docker02 ~]# docker images 
REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
busybox                     latest              5b0d59026729        8 days ago          1.15MB
10.0.0.100/xcn/centos6.8   1.0                 6704d778b3ba        2 months ago        195MB
centos                      6.8                 6704d778b3ba        2 months ago        195MB
[root@docker02 ~]# docker login 10.0.0.100
Username: admin
Password: 
Login Succeeded

5、推送镜像

[root@docker02 ~]# docker push 10.0.0.100/xcn/centos6.8 
The push refers to repository [10.0.0.100/xcn/centos6.8]
e00c9229b481: Pushing  13.53MB/194.5MB
posted @ 2018-05-24 11:33  云原生运维社区  阅读(158)  评论(0编辑  收藏  举报