首页 > 其他 > 详细

harbor镜像仓库安装配置

时间:2019-11-09 01:25:15      阅读:41      评论:0      收藏:0      [点我收藏+]

标签:ins   from   conf   ucc   mct   ica   

#依赖包安装

[[email protected] harbor]# yum -y install epel-release

[[email protected] harbor]# yum install -y python-pip

[[email protected] harbor]# pip install docker-compose

#harbor安装包去官网下载你需要的版本(https://github.com/goharbor/harbor/releases)

[[email protected] src]# tar zxvf harbor-offline-installer-v1.3.0.tgz

[[email protected] src]# cd harbor
[[email protected] harbor]# ls
common                    docker-compose.notary.yml  harbor_1_1_0_template  harbor.v1.3.0.tar.gz  LICENSE  prepare
docker-compose.clair.yml  docker-compose.yml         harbor.cfg             install.sh            NOTICE   upgrade

[[email protected] harbor]# vim harbor.cfg

hostname = 192.168.1.130 #这里写域名或IP

harbor_admin_password = 12345 #登录密码

 

[[email protected] harbor]# sh install.sh

[Step 0]: checking installation environment ...

Note: docker version: 1.13.1

Note: docker-compose version: 1.24.1

[Step 1]: loading Harbor images ...
49c2c19b0cd0: Loading layer [==================================================>] 135.8 MB/135.8 MB
43871d066430: Loading layer [==================================================>] 30.94 MB/30.94 MB
6e35eebca0b3: Loading layer [==================================================>] 7.071 MB/7.071 MB
72366ac0a61c: Loading layer [==================================================>] 7.071 MB/7.071 MB
Loaded image: vmware/harbor-adminserver:v1.3.0

。。。。。。

[Step 3]: checking existing instance of Harbor ...


[Step 4]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating harbor-db          ... done
Creating registry           ... done
Creating harbor-adminserver ... done
Creating harbor-ui          ... done
Creating nginx              ... done
Creating harbor-jobservice  ... done

? ----Harbor has been installed and started successfully.----

Now you should be able to visit the admin portal at http://192.168.1.130.
For more details, please visit https://github.com/vmware/harbor .

 

技术分享图片

 

 

 技术分享图片

 

 

 推送镜像

技术分享图片

 

 

 #回docker服务器中给要推送的镜像打tag

[[email protected] harbor]# docker tag 540a289bab6c 192.168.1.130/library/nginx:v1

技术分享图片

 #登录harbor并将镜像push到harbor上(如果无法登录下面有参考解决办法)

 [[email protected] harbor]# docker login 192.168.1.130
Username: admin
Password:
Login Succeeded
[[email protected] harbor]# docker push 192.168.1.130/library/nginx:v1

 技术分享图片

 

 技术分享图片

 

 

 

#登录harbor报错

[[email protected] harbor]# docker login 192.168.1.130
Username: admin
Password:
Error response from daemon: Get https://192.168.1.130/v1/users/: dial tcp 192.168.1.130:443: connect: connection refused

#解决步骤

[[email protected] harbor]# find / -name docker.service -type f

[[email protected] harbor]# cd /usr/lib/systemd/system

[[email protected] system]# vim docker.service

[Service]
Type=notify
NotifyAccess=main
EnvironmentFile=-/run/containers/registries.conf
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
Environment=DOCKER_HTTP_HOST_COMPAT=1
Environment=PATH=/usr/libexec/docker:/usr/bin:/usr/sbin
ExecStart=/usr/bin/dockerd-current           --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current           --default-runtime=docker-runc           --exec-opt native.cgroupdriver=systemd           --userland-proxy-path=/usr/libexec/docker/docker-proxy-current           --init-path=/usr/libexec/docker/docker-init-current           --insecure-registry=192.168.1.130           --seccomp-profile=/etc/docker/seccomp.json           $OPTIONS           $DOCKER_STORAGE_OPTIONS           $DOCKER_NETWORK_OPTIONS 。。。。。。

[[email protected] system]# systemctl daemon-reload
[[email protected] system]# systemctl restart docker
[[email protected] system]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-11-01 09:25:30 CST; 4s ago
     Docs: http://docs.docker.com

 一般到此基本是就没问题了,但有部分人品差的可能因为重启docker导致harbor的NGINX服务端失效,依然无法login

[[email protected] harbor]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:1514          0.0.0.0:*               LISTEN      39506/docker-proxy-
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      856/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1193/master         
tcp6       0      0 :::22                   :::*                    LISTEN      856/sshd            
tcp6       0      0 ::1:25                  :::*                    LISTEN      1193/master   

[[email protected] harbor]# docker-compose ps
       Name                     Command                  State                 Ports          
----------------------------------------------------------------------------------------------
harbor-adminserver   /harbor/start.sh                 Up (healthy)                            
harbor-db            /usr/local/bin/docker-entr ...   Up (healthy)   3306/tcp                 
harbor-jobservice    /harbor/start.sh                 Up (healthy)                            
harbor-log           /bin/sh -c /usr/local/bin/ ...   Up (healthy)   127.0.0.1:1514->10514/tcp
harbor-ui            /harbor/start.sh                 Up (healthy)                            
nginx                nginx -g daemon off;             Restarting                              
registry             /entrypoint.sh serve /etc/ ...   Up (healthy)   5000/tcp                 
[[email protected] harbor]# docker-compose stop
Stopping harbor-jobservice  ... done
Stopping nginx              ... done
Stopping harbor-ui          ... done
Stopping harbor-adminserver ... done
Stopping registry           ... done
Stopping harbor-db          ... done
Stopping harbor-log         ... done

 [[email protected] harbor]# docker-compose start
Starting log         ... done
Starting adminserver ... done
Starting registry    ... done
Starting ui          ... done
Starting mysql       ... done
Starting jobservice  ... done
Starting proxy       ... done
[[email protected] harbor]# docker-compose ps
       Name                     Command                       State                                        Ports                              
----------------------------------------------------------------------------------------------------------------------------------------------
harbor-adminserver   /harbor/start.sh                 Up (health: starting)                                                                   
harbor-db            /usr/local/bin/docker-entr ...   Up (health: starting)   3306/tcp                                                        
harbor-jobservice    /harbor/start.sh                 Up (health: starting)                                                                   
harbor-log           /bin/sh -c /usr/local/bin/ ...   Up (health: starting)   127.0.0.1:1514->10514/tcp                                       
harbor-ui            /harbor/start.sh                 Up (health: starting)                                                                   
nginx                nginx -g daemon off;             Up                      0.0.0.0:443->443/tcp, 0.0.0.0:4443->4443/tcp, 0.0.0.0:80->80/tcp
registry             /entrypoint.sh serve /etc/ ...   Up (health: starting)   5000/tcp   

 [[email protected] harbor]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:1514          0.0.0.0:*               LISTEN      46955/docker-proxy-
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      856/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1193/master         
tcp6       0      0 :::80                   :::*                    LISTEN      47361/docker-proxy-
tcp6       0      0 :::22                   :::*                    LISTEN      856/sshd            
tcp6       0      0 ::1:25                  :::*                    LISTEN      1193/master         
tcp6       0      0 :::443                  :::*                    LISTEN      47342/docker-proxy-
tcp6       0      0 :::4443                 :::*                    LISTEN      47331/docker-proxy-

 

 

 

 

harbor镜像仓库安装配置

标签:ins   from   conf   ucc   mct   ica   

原文:https://www.cnblogs.com/sparkss/p/11820926.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 bubuko.com 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号