full_container_scheme/1.docs/2.1 harbor.md

50 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!--
* @Author: admin@attacker.club
* @Date: 2022-09-14 21:38:54
* @LastEditTime: 2024-03-05 22:26:51
* @Description:
-->
# harbor 镜像仓库
```bash
wget -c https://github.com/goharbor/harbor/releases/download/v2.3.4/harbor-offline-installer-v2.3.4.tgz
tar zxvf harbor-offline-installer*.tgz
cd harbor
cp harbor.yml.tmpl harbor.yml
grep hostname harbor.yml
# 修改 hostname地址http,https配置
./install.sh # 执行安装脚本
## compose启动
docker-compose down
docker-compose up -d
## 登录私有仓库 dockerhub
docker login
## 登录私有仓库
docker login harbor.opsbase.cn
```
## 更新证书
```bash
# 如果证书
cd harbor/
docker cp harbor.enterx.cc.key nginx:/etc/cert/server.key
docker cp harbor.enterx.cc_bundle.pem nginx:/etc/cert/server.crt
docker-compose down && docker-compose up -d
```
## tag 使用
```bash
docker tag myblog:v1 harbor.opsbase.cn/public/myblog:v1
docker push harbor.opsbase.cn/public/myblog:v1
# 打tag 推送到harbor
docker pull harbor.opsbase.cn/public/myblog:v1
# 拉取镜像到本地
```