当前位置:网站首页>Harbor镜像仓库搭建
Harbor镜像仓库搭建
2022-07-05 11:18:00 【吉松松】
Harbor镜像仓库搭建
1、安装底层需求
- Python应该是2.7或更高版本
- Docker引擎应为1.10或更高版本
- DockerCompose需要为1.6.0或更高版本
2、Harbor安装
Harbor 官方地址:
https://github.com/vmware/harbor/releases
配置harbor.yml
$ tar -zxvf harbor-online-installer-v2.5.2.tgz #采用在线安装
$ cd harbor && vim harbor.yml
...
hostname: harbor.registry.com #目标的主机名或者完全限定域名
http: #默认http协议,如果https能用,可自动跳转https
port: 80 #对外访问端口
#https: #https需要证书可先注释
# port: 443
# certificate: /your/certificate/path #证书存放路径
# private_key: /your/private/key/path #私钥存放路径
...
harbor_admin_password: Harbor12345 #登录harbor默认密码
database:
password: root123 #数据库默认连接密码
....
data_volume: /data #设置Harbor的数据存放目录
...
log: #设置日志相关信息
level: info #设置日志级别
local:
rotate_count: 50 #日志保留个数
rotate_size: 200M #每个日志大小
location: /var/log/harbor #日志存放路径
$ ./install.sh
[Step 4]: starting Harbor ...
.....
----Harbor has been installed and started successfully.---- #表示搭建成功
使用命令行登陆Harbor,并上传镜像和下载镜像
由于docker拉取镜像默认是https协议,我们需要在/etc/docker/daemon.json中配置insecure-registries.
{
"insecure-registries": ["harbor.registry.com"] }
$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
170.18.9.141 harbor.registry.com
$ systemctl restart docker
$ docker login harbor.registry.com #登录仓库,认证信息保留在/家目录下/.docker/config.json文件中
Username: admin
Password:
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
#给镜像打上符合仓库的标签镜像
$ docker tag nginx:latest harbor.registry.com/library/nginx:v1
#推送镜像
$ docker push harbor.registry.com/library/nginx:v1
The push refers to repository [harbor.registry.com/library/nginx]
e7344f8a29a3: Pushed
44193d3f4ea2: Pushed
41451f050aa8: Pushed
b2f82de68e0d: Pushed
d5b40e80384b: Pushed
08249ce7456a: Pushed
v1: digest: sha256:3536d368b898eef291fb1f6d184a95f8bc1a6f863c48457395aab859fda354d1 size: 1570
配置Harbor的HTTPS访问
参考栈内文章自制https证书,生成证书后,放入harbor.yml配置文件的中certificate,private_key参数对应的路径下即可。
边栏推荐
- 【全网首发】(大表小技巧)有时候 2 小时的 SQL 操作,可能只要 1 分钟
- 不要再说微服务可以解决一切问题了!
- go语言学习笔记-初识Go语言
- About the use of Vray 5.2 (self research notes)
- AutoCAD -- mask command, how to use CAD to locally enlarge drawings
- 【爬虫】wasm遇到的bug
- Scaffold development foundation
- 分类TAB商品流多目标排序模型的演进
- NFT 交易市场主要使用 ETH 本位进行交易的局面是如何形成的?
- Three suggestions for purchasing small spacing LED display
猜你喜欢
AUTOCAD——遮罩命令、如何使用CAD对图纸进行局部放大
COMSOL--建立几何模型---二维图形的建立
Broyage · fusion | savoir que le site officiel de chuangyu mobile end est en ligne et commencer le voyage de sécurité numérique!
【广告系统】Parameter Server分布式训练
Codeforces Round #804 (Div. 2)
【Office】Excel中IF函数的8种用法
[office] eight usages of if function in Excel
华为设备配置信道切换业务不中断
32: Chapter 3: development of pass service: 15: Browser storage media, introduction; (cookie,Session Storage,Local Storage)
Question bank and answers of special operation certificate examination for main principals of hazardous chemical business units in 2022
随机推荐
Modulenotfounderror: no module named 'scratch' ultimate solution
COMSOL--三维随便画--扫掠
Characteristics and electrical parameters of DDR4
[advertising system] incremental training & feature access / feature elimination
[TCP] TCP connection status JSON output on the server
如何让全彩LED显示屏更加节能环保
2022 Pengcheng cup Web
I used Kaitian platform to build an urban epidemic prevention policy inquiry system [Kaitian apaas battle]
Summary of thread and thread synchronization under window
【Oracle】使用DataGrip连接Oracle数据库
磨礪·聚變|知道創宇移動端官網煥新上線,開啟數字安全之旅!
Do you really understand the things about "prototype"? [part I]
sklearn模型整理
C # to obtain the filtered or sorted data of the GridView table in devaexpress
C language current savings account management system
龙蜥社区第九次运营委员会会议顺利召开
一次edu证书站的挖掘
Question bank and answers of special operation certificate examination for main principals of hazardous chemical business units in 2022
Applet framework taro
DDR4的特性与电气参数