harbor2.8.3安装步骤step by step

开始

网上找的步骤都有点问题,不能做到step by step成功,所以记录下我的步骤。

包准备

安装

tar zxvf harbor-offline-installer-v2.8.3.tgz -C /usr/local/
cd /usr/local/harbor/
cp harbor.yml.tmpl harbor.yml
vim harbor.yml
## 只用修改hostname和http端口,再把https的内容删除或者注释
hostname: 192.168.7.135
http:
  port: 1180

保存,退出

./install.sh
  • 打开浏览器输入192.168.7.135:1180,默认账户admin/Harbor12345,可以在harbor.yml中修改。
    在项目里可以看到有library这个默认项目,这样就安装完毕了。

测试

先上传一个包,在本机上操作
[root@localhost harbor]# docker login -u admin -p Harbor12345 http://127.0.0.1:1180
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
-- 先下一个测试包
[root@localhost harbor]# docker pull httpd
[root@localhost harbor]# docker tag httpd:latest 127.0.0.1:1180/library/httpd:v1
[root@localhost harbor]# docker push 127.0.0.1:1180/library/httpd:v1
The push refers to repository [127.0.0.1:1180/library/httpd]
deefaa620a71: Pushed 
9cff3206f9a6: Pushed 
15e4bf5d0804: Pushed 
1da636a1aa95: Pushed 
2edcec3590a4: Pushed 
v1: digest: sha256:57c1e4ff150e2782a25c8cebb80b574f81f06b74944caf972f27e21b76074194 size: 1365

去页面上刷新一下,就可以看到上传的包了。
在这里插入图片描述

在其它机器上下载

另起一台机器192.168.7.136,先装上docker

[root@localhost harbor]# vim /etc/docker/daemon.json
{
  "insecure-registries": ["192.168.7.135:1180"]
}

[root@localhost harbor]# systemctl daemon-reload && systemctl restart docker
[root@localhost system]# docker login -u admin -p Harbor12345 http://192.168.7.135:1180
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
[root@localhost system]# docker pull 192.168.7.135:1180/library/httpd:v1
v1: Pulling from library/httpd
a2abf6c4d29d: Pull complete 
dcc4698797c8: Pull complete 
41c22baa66ec: Pull complete 
67283bbdd4a0: Pull complete 
d982c879c57e: Pull complete 
Digest: sha256:57c1e4ff150e2782a25c8cebb80b574f81f06b74944caf972f27e21b76074194
Status: Downloaded newer image for 192.168.7.135:1180/library/httpd:v1
192.168.7.135:1180/library/httpd:v1
[root@localhost system]# docker images
REPOSITORY                         TAG       IMAGE ID       CREATED         SIZE
postgis/postgis                    15-3.3    a716de7a5abb   9 months ago    589MB
192.168.7.135:1180/library/httpd   v1        dabbfbe0c57b   19 months ago   144MB

妥。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值