我本机的IP是172.xx.x.x,装了一个ubuntu18的虚拟机(虚拟机的IP是192.168.33.5),下文中使用的Docker版本都是17.12。我本地使用的开发环境是Ubuntu18,在本机和虚拟机上都要安装Docker,安装Docker的步骤在这里就再也不给出。目的是在虚拟机里面安装Harbor,以后本机推送、下载镜像。git
从github上下载离线安装包,下载连接,https://storage.googleapis.com/harbor-releases/release-1.7.0/harbor-offline-installer-v1.7.1.tgzgithub
List-1.1 ubuntu
#解压 [root@localhost data]# tar xf harbor-offline-installer-v1.7.1.tgz
修改harbor/harbor.cfg的host.name和harbor_admin_password,hostname修改成虚拟机的IP,harbor_admin_password有个默认值,可是咱们在这里修改成下,后面登陆会使用到,以下,能够将hostname设置为域名,如harbor.com,这样是有好处的。api
List-2.1浏览器
#修改harbor.cfg [root@localhost data]# vi harbor/harbor.cfg ... #修改数据存储的路径 secretkey_path=xxx ... #以下为修改后的 ...... #The IP address or hostname to access admin UI and registry service. #DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients. #DO NOT comment out this line, modify the value of "hostname" directly, or the installation will fail. hostname = 192.168.33.5 ...... ##The initial password of Harbor admin, only works for the first time when Harbor starts. #It has no effect after the first launch of Harbor. #Change the admin password from UI after launching Harbor. harbor_admin_password = xxxx ......
List-3.1 执行prepare文件bash
[root@localhost data]# ./harbor/prepare
List-3.2 执行install.sh文件this
[root@localhost data]# ./harbor/install.sh
以后直接用浏览器访问http://192.168.33.5,就能够看到一个登陆界面,用户名是admin,密码是List-2.1中的harbor_admin_password的值google
4、本地如何推送镜像到Harbor上spa
在登陆Harbor后,首先建立用户,以下所示,"Users" -> "NEW USER",以后会弹出一个输入框,要咱们输入用户名、密码等,这个后面会用到code
图4.1