type
status
date
slug
summary
tags
category
icon
password
AI summary
Last edited time
Apr 11, 2024 06:56 AM
为什么选 nexus3 不选 harbor
因为穷, 家里的闲置主机资源配置一般, 已经跑了以下应用
- PVE(是的, 我在闲置主机上先装了 PVE)
- 基于 PVE 的 Debian
- nexus3(对, 就是那个大名鼎鼎的 java maven 自建私服应用)
- gitea(有些小项目我懒得放 github)
- mysql8
- nginx
- syncthing
- xxl-job-admin
- java 爬虫应用
harbor 的组件太多, 我不想再装 postgres 等数据库了(感觉躲不过, 下一步的 sonarqube 好像要用 postgres)
配置说明
nexus 配置
以下 repository 配置都不需要勾选启用 v1 的 api
- 添加 docker-hub 的 proxy, 这里用的阿里云镜像

- 添加谷歌镜像的代理 ghcr.io

- 添加微软镜像的代理(playwright-java 的 docker 镜像在这)

- 添加自建仓库

- 再搞一个聚合的仓库, 用来对自己提供镜像缓存, 6000 端口用来单独配置反向代理

nginx 反向代理配置
docker-mirror.sephy.io → nexus:6000 端口
docker-registry.sephy.io → nexus:6001 端口
因为频繁的遇到 docker pull 时都通过 https 方式从 docker-registry.sephy.io 获取镜像, 这里还通过 Fishdrowned 的 项目来生成了自签的证书来配置 nginx https://docker-registry.sephy.io
ssl
Fishdrowned • Updated Apr 10, 2024
汇总如下
仓库 | repository 类型 | 代理目标 | http 端口 | 域名 |
docker-hub | proxy | 阿里云公共镜像 | ㅤ | ㅤ |
docker-ghcr | proxy | 谷歌镜像 | ㅤ | ㅤ |
docker-mcr | proxy | 微软镜像 | ㅤ | ㅤ |
docker-self | hosted | 自建镜像 | 6001 | docker-registry.sephy.io |
docker-public | group | 聚合镜像 | 6000 | docker-mirror.sephy.io |
docker 配置
/etc/docker/daemon.json
改完 daemon.json 后需要重启 docker, 并登录到私有仓库
验证一下上传自定义镜像到私服
效果展示
聚合的 docker-public 库

ghcr 缓存

微软缓存

阿里云镜像缓存

自建私服缓存
