惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Heimdal Security Blog
S
Security @ Cisco Blogs
N
News | PayPal Newsroom
J
Java Code Geeks
罗磊的独立博客
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic
V
V2EX
WordPress大学
WordPress大学
Google Online Security Blog
Google Online Security Blog
N
News and Events Feed by Topic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
月光博客
月光博客
AI
AI
小众软件
小众软件
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
美团技术团队
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Tailwind CSS Blog
S
Schneier on Security
博客园 - 三生石上(FineUI控件)
F
Full Disclosure
B
Blog RSS Feed
Forbes - Security
Forbes - Security
S
SegmentFault 最新的问题
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
Jina AI
Jina AI
Cisco Talos Blog
Cisco Talos Blog
U
Unit 42
Project Zero
Project Zero
H
Hacker News: Front Page
Y
Y Combinator Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
S
Secure Thoughts
The Hacker News
The Hacker News
Microsoft Azure Blog
Microsoft Azure Blog

博客 on 打工人日志

k8s RKE2 cilium L2 + envoy gateway 安装配置 k8s RKE2 vSphere 存储配置 OpenClaw 全能指南:从安装到进阶自动化实战 (2026 最终版) Kubernetes — skywalking + banyanDB APM监控部署 Kubernetes — promtail + loki + grafana 日志系统部署 k8s master 节点 Unauthorized Kubernetes — metalLB + Traefik 部署 Kubernetes — SSL 证书自动更新 Kubernetes — RKE2 + kube-vip + cilium 部署 使用TLSv1.3 升级nginx和openssl Proxmox VE(PVE) 更新到最新版本 kindle 邮件发送失败,错误代码E999 metallb + ingress-nginx + argocd 本地部署 iStoreOS(旁路由)使用openclash实现dns劫持 异常流量分析:图片库服务黑客入侵 openwrt 硬盘扩容 搭建ip地址检索服务 Kubernetes — k8s 手动安装 1.17.9 SELinux 问题:导致端口无法创建,无法访问 【福利】免费!本地部署!去除视频中移动的物体 通知:《打工人日报》迁移到独立板块 KyBook 3 | calibre-web - IOS系统最佳图书伴侣 Tmux 安装和使用教程 DockerHub 加速镜像部署 - 使用cloudflare 代理 docker的零停机部署 SD-webui 批量处理图片 ubuntu 安装 ComfyUI ubuntu 安装 stable-diffusion-webui 测试策略:微服务架构 单元测试:测试单元质量提升 端到端测试:模拟用户体验 Kubernetes — containerd 安装和部署 CI/CD 可观察性-基于grafana Argo cd 安装和部署 linux服务器进程打开文件过多导致服务异常 使用 ElasticSearch Curator 7天定期删除日志 sonarqube docker安装和配置 SSH 通过 443 端口连接 GitHub iOS 17 「待机显示」适配普通 iPhone(非 Pro/Max),屏幕在充电时常亮 GNU/Linux 一键更换系统软件源脚本 解决Elasticsearch索引只读(read-only) 【福利】埃隆·马斯克传 [沃尔特·艾萨克森] 在线下载 【破解】小鹏P5和小鹏G9开启adb和网络adb Kubernetes — kubecost 分析 Kubernetes 成本 3D Gaussian Splatting:3D模型渲染 Linux 系统收包流程以及内核参数优化 2023亚运会电竞门票民购买指南(报名+抽签) Vue3 + vite + nginx项目部署后404问题 大麦抢票辅助软件(福利 TFBOYS十年之约演唱会 2023 全机位 视频) 黑群晖最新安装教程 Ansible部署ceph集群 最好的微信朋友圈集赞神器-福利推荐 推荐一下 容器云资源 2010年的天涯神贴聊房价 如何礼貌回绝不合理的需求 nginx 配置和编译 github 国内代理访问下载 使用scrapy-redis实现增量爬取 逆境和成长-2022年终总结 优雅的使用Conda管理python环境 Jenkins 编译Android apk 流水线 Kubernetes — 更新证书 shell功能脚本集合 Nexus3 使用和部署 githubAction set-output弃用错误 Kubernetes — Rook云存储介绍和部署 Kubernetes — 基于K8S搭建Ceph分布式存储 Kubernetes — 探针和生命周期 Kubernetes — 开放标准(OCI、CRI、CNI、CSI、SMI、CPI)概述 kubernetes 部署插件 (Flannel、Web UI、CoreDNS、Ingress Controller) Cloudflare Zero Trust 内网穿透 k8s CNI 问题 连接认证失效 k8s.gcr.io国内无法连接解决方法 headscale 部署使用 羊了个羊小程序 破解通关 K8S 问题排查:cgroup 内存泄露问题 RocketMQ k8s部署 4主4从集群 docker 问题处理 kubernetes 存储 linux服务器 删除空间却未释放 kubernetes 从1.23.x 升级到 1.24.x 编写 kubernetes 资源描述文件 nginx ssh-key connection exception kubernetes manual expansion VSCode插件推荐=> Code Runner ant build.xml 编写 kubernetes 调度过程 记录一次上门打散工 k8s本地联调神器kt-connect Ant中如何添加第三方jar包依赖 OpenELB:让k8s私有环境对外暴露端口 linux 网络测速 安装 docker 出现 ERROR: Unsupported distribution 'ol' 问题 logrotate 日志滚动的使用 nginx 编译参数详解 nginx 重写规则 rewrite模块 nginx.conf 配置文件详解 rsync 文件同步 163企业邮箱设置教程 2021年第50周记
Harbor 搭建
2022-01-14 · via 博客 on 打工人日志

Harbor 搭建

Harbor 是一个开源可信的云原生注册表项目,用于存储、签名和扫描内容。用于存储 docker image

要求

  1. Linux 主机
  2. docker 17.06.0-ce 以上
  3. docker-compose 1.18.0 以上

链接跳转:docker 安装

安装

  1. 下载程序

在线安装包

1wget https://github.com/goharbor/harbor/releases/download/v1.10.10/harbor-online-installer-v1.10.10.tgz

离线安装包

1wget https://github.com/goharbor/harbor/releases/download/v1.10.10/harbor-offline-installer-v1.10.10.tgz
  1. 安装
1mkdir -p /data
2cd /data
3tar -zxvf harbor-offline-installer-v1.10.10.tgz
4cd /harbor
5./install.sh

接下来只要安静的等待安装就可以了

配置

  1# Configuration file of Harbor
  2
  3# The IP address or hostname to access admin UI and registry service.
  4# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
  5hostname: <域名>
  6
  7# http related config
  8http:
  9  # port for http, default is 80. If https enabled, this port will redirect to https port
 10  port: 80
 11
 12# https related config
 13https:
 14  # https port for harbor, default is 443
 15  port: 443
 16  # SSL证书
 17  certificate: /hub/ssl/bundle.pem
 18  private_key: /hub/ssl/key
 19
 20# Uncomment external_url if you want to enable external proxy
 21# And when it enabled the hostname will no longer used
 22# external_url: https://reg.mydomain.com:8433
 23
 24# The initial password of Harbor admin
 25# It only works in first time to install harbor
 26# Remember Change the admin password from UI after launching Harbor.
 27harbor_admin_password: <密码>
 28
 29# Harbor DB configuration
 30database:
 31  # The password for the root user of Harbor DB. Change this before any production use.
 32  password: <密码>
 33  # The maximum number of connections in the idle connection pool. If it <=0, no idle connections are retained.
 34  max_idle_conns: 50
 35  # The maximum number of open connections to the database. If it <= 0, then there is no limit on the number of open connections.
 36  # Note: the default number of connections is 100 for postgres.
 37  max_open_conns: 100
 38
 39# The default data volume
 40data_volume: /data
 41
 42# Harbor Storage settings by default is using /data dir on local filesystem
 43# Uncomment storage_service setting If you want to using external storage
 44# storage_service:
 45#   # ca_bundle is the path to the custom root ca certificate, which will be injected into the truststore
 46#   # of registry's and chart repository's containers.  This is usually needed when the user hosts a internal storage with self signed certificate.
 47#   ca_bundle:
 48
 49#   # storage backend, default is filesystem, options include filesystem, azure, gcs, s3, swift and oss
 50#   # for more info about this configuration please refer https://docs.docker.com/registry/configuration/
 51#   filesystem:
 52#     maxthreads: 100
 53#   # set disable to true when you want to disable registry redirect
 54#   redirect:
 55#     disabled: false
 56
 57# Clair configuration
 58clair:
 59  # The interval of clair updaters, the unit is hour, set to 0 to disable the updaters.
 60  updaters_interval: 12
 61
 62jobservice:
 63  # Maximum number of job workers in job service
 64  max_job_workers: 10
 65
 66notification:
 67  # Maximum retry count for webhook job
 68  webhook_job_max_retry: 10
 69
 70chart:
 71  # Change the value of absolute_url to enabled can enable absolute url in chart
 72  absolute_url: disabled
 73
 74# Log configurations
 75log:
 76  # options are debug, info, warning, error, fatal
 77  level: info
 78  # configs for logs in local storage
 79  local:
 80    # Log files are rotated log_rotate_count times before being removed. If count is 0, old versions are removed rather than rotated.
 81    rotate_count: 50
 82    # Log files are rotated only if they grow bigger than log_rotate_size bytes. If size is followed by k, the size is assumed to be in kilobytes.
 83    # If the M is used, the size is in megabytes, and if G is used, the size is in gigabytes. So size 100, size 100k, size 100M and size 100G
 84    # are all valid.
 85    rotate_size: 200M
 86    # The directory on your host that store log
 87    location: /var/log/harbor
 88
 89  # Uncomment following lines to enable external syslog endpoint.
 90  # external_endpoint:
 91  #   # protocol used to transmit log to external endpoint, options is tcp or udp
 92  #   protocol: tcp
 93  #   # The host of external endpoint
 94  #   host: localhost
 95  #   # Port of external endpoint
 96  #   port: 5140
 97
 98#This attribute is for migrator to detect the version of the .cfg file, DO NOT MODIFY!
 99_version: 1.10.0
100
101# Uncomment external_database if using external database.
102# external_database:
103#   harbor:
104#     host: harbor_db_host
105#     port: harbor_db_port
106#     db_name: harbor_db_name
107#     username: harbor_db_username
108#     password: harbor_db_password
109#     ssl_mode: disable
110#     max_idle_conns: 2
111#     max_open_conns: 0
112#   clair:
113#     host: clair_db_host
114#     port: clair_db_port
115#     db_name: clair_db_name
116#     username: clair_db_username
117#     password: clair_db_password
118#     ssl_mode: disable
119#   notary_signer:
120#     host: notary_signer_db_host
121#     port: notary_signer_db_port
122#     db_name: notary_signer_db_name
123#     username: notary_signer_db_username
124#     password: notary_signer_db_password
125#     ssl_mode: disable
126#   notary_server:
127#     host: notary_server_db_host
128#     port: notary_server_db_port
129#     db_name: notary_server_db_name
130#     username: notary_server_db_username
131#     password: notary_server_db_password
132#     ssl_mode: disable
133
134# Uncomment external_redis if using external Redis server
135# external_redis:
136#   host: redis
137#   port: 6379
138#   password:
139#   # db_index 0 is for core, it's unchangeable
140#   registry_db_index: 1
141#   jobservice_db_index: 2
142#   chartmuseum_db_index: 3
143#   clair_db_index: 4
144
145# Uncomment uaa for trusting the certificate of uaa instance that is hosted via self-signed cert.
146# uaa:
147#   ca_file: /path/to/ca
148
149# Global proxy
150# Config http proxy for components, e.g. http://my.proxy.com:3128
151# Components doesn't need to connect to each others via http proxy.
152# Remove component from `components` array if want disable proxy
153# for it. If you want use proxy for replication, MUST enable proxy
154# for core and jobservice, and set `http_proxy` and `https_proxy`.
155# Add domain to the `no_proxy` field, when you want disable proxy
156# for some special registry.
157proxy:
158  http_proxy:
159  https_proxy:
160  # no_proxy endpoints will appended to 127.0.0.1,localhost,.local,.internal,log,db,redis,nginx,core,portal,postgresql,jobservice,registry,registryctl,clair,chartmuseum,notary-server
161  no_proxy:
162  components:
163    - core
164    - jobservice
165    - clair

harbor 配置和使用

配置host地址

1192.168.0.230 harbor.dev

配置docker参数

查找docker.service地址

我的地址是 /usr/lib/systemd/system/docker.service

1vim /usr/lib/systemd/system/docker.service

增加 --insecure-registry=harbor.dev

 1[Unit]
 2Description=Docker Application Container Engine
 3Documentation=https://docs.docker.com
 4After=network-online.target docker.socket firewalld.service containerd.service time-set.target
 5Wants=network-online.target containerd.service
 6Requires=docker.socket
 7
 8[Service]
 9Type=notify
10# the default is not to use systemd for cgroups because the delegate issues still
11# exists and systemd currently does not support the cgroup feature set required
12# for containers run by docker
13# 增加 私有harbor 地址
14ExecStart=/usr/bin/dockerd -H fd:// --insecure-registry=harbor.dev  --containerd=/run/containerd/containerd.sock
15ExecReload=/bin/kill -s HUP $MAINPID
16TimeoutStartSec=0
17RestartSec=2
18Restart=always
19
20# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
21# Both the old, and new location are accepted by systemd 229 and up, so using the old location
22# to make them work for either version of systemd.
23StartLimitBurst=3
24
25# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
26# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
27# this option work for either version of systemd.
28StartLimitInterval=60s
29
30# Having non-zero Limit*s causes performance problems due to accounting overhead
31# in the kernel. We recommend using cgroups to do container-local accounting.
32LimitNOFILE=infinity
33LimitNPROC=infinity
34LimitCORE=infinity
35
36# Comment TasksMax if your systemd version does not support it.
37# Only systemd 226 and above support this option.
38TasksMax=infinity
39
40# set delegate yes so that systemd does not reset the cgroups of docker containers
41Delegate=yes
42
43# kill only the docker process, not all processes in the cgroup
44KillMode=process
45OOMScoreAdjust=-500
46
47[Install]
48WantedBy=multi-user.target

重新加载docker

1sudo systemctl daemon-reload
2sudo systemctl restart docker

登陆

在你需要上传的服务器上执行

输入用户名和密码,出现以下提示说明登录成功

推送到harbor

标记本地镜像, 将其归入某一仓库,这里使用test仓库

docker tag <域名>/<仓库>/<镜像名>:<版本号>

1docker tag 127.0.0.1/test/nginx:v1

将本地镜像推送到镜像仓库(需先登录镜像仓库)

1docker push 127.0.0.1/test/nginx:v1