Kubernetes学习之路(28)之镜像仓库Harbor部署

Harbor的部署

官方文档git

Harbor有两种安装的方式:github

一、环境需求docker

目标主机须要部署Docker和Docker-compose,如下为官方的软硬件要求:json

硬件需求vim

资源 容量 推荐配置
CPU >= 2C >= 4C
Memory >= 4GB >= 8GB
Disk >= 40GB >= 160GB

软件需求api

软件 版本
Docker Engine >= 17.06.0-ce
Docker Compose >= 1.18.0
Openssl 最新版本

二、安装步骤bash

安装步骤归结为如下内容服务器

  • (1)下载安装程序,并安装docker-compose;
  • (2)配置harbor.yml ;
  • (3)运行install.sh安装并启动Harbor;
# wget https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-offline-installer-v1.8.2.tgz

# curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

# chmod +x /usr/local/bin/docker-compose 

# tar -zxf harbor-offline-installer-v1.8.2.tgz

# cd harbor && vim harbor.yml
hostname: 192.168.56.110        #更改hostname
harbor_admin_password: admin123    #更改harbor初始化密码,或者用默认帐号密码admin Harbor12345,可是若是使用初始化密码,登陆之后要当即更改,不然下次启动时,会没法进入harbor,别问为啥,这就是一个坑!!!


# ./install.sh
......
✔ ----Harbor has been installed and started successfully.----

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

三、登陆Harbor UI

curl

四、命令行登陆tcp

[root@k8s-master ~]# docker login 192.168.56.110
Username: admin
Password: 
Error response from daemon: Get https://192.168.56.110/v2/: dial tcp 192.168.56.110:443: connect: connection refused

有如下两种解决方案:

(1)在须要登录的docker client端修改lib/systemd/system/docker.service文件,在里面修改ExecStart那一行,增长--insecure-registry=192.168.56.110,而后重启docker (systemctl daemon-reload systemctl restart docker)

(2)在harbor服务器端修改 /etc/docker/daemon.json(若是没有这个文件,本身建),修改后,一样运行 (systemctl daemon-reload systemctl restart docker)

相关文章
相关标签/搜索