|

需求:网上其实有很多关于 Docker 部署 Nexus 3 的教程,但是 Nexus3 在部署过程中需要进行调优,关闭一些不必要的配置功能。例如:遥感分析、包漏洞检查、恶意软件警告等功能(部分功能都需要连网,为了防止隐私泄露,建议关闭)。很多存储库功能比较单一,有的只能做 nuget 包,有的只能做 npm 包,有的只能做 docker 镜像,每个都搭建的话,非常费事,维护起来也比较麻烦。
回顾:
Nexus
官网:https://www.sonatype.com/
下载:https://help.sonatype.com/en/download-archives---repository-manager-3.html
社区版源码:https://github.com/sonatype/nexus-public
Nexus Repository 3.70.x Downloads with OrientDB 和 Download Archives - Repository Manager 3 区别是什么?
Sonatype Nexus Repository 社区版是帮助个人开发者和小型团队有效管理组件的完美解决方案——而且完全免费!作为我们原有 Sonatype Nexus Repository OSS 的下一代演进,社区版为您提供了旨在满足当今快速发展的开发团队需求的现代化功能。
社区版限制
Sonatype Nexus Repository 社区版旨在为个人用户和小型团队提供强大的存储库管理。它支持最多100,000 个组件和每天 200,000 个请求。
对于少数规模较大或使用率较高的团队,如果超出这些限制,社区版的内置安全措施将暂停添加新组件,直到使用率恢复到两个阈值以下。这使得我们的免费社区版与团队和小型组织保持一致,并确保大型企业通过专业版获得可靠运行关键任务系统所需的支持和企业级功能。
功能比较
参考:https://help.sonatype.com/en/nexus-repository-feature-matrix.html
存储库格式
从3.x开始,它默认支持许多主流的软件包格式:
- Bower
- Docker
- Git LFS
- Maven
- npm
- NuGet
- PyPI
- Ruby
- Gems
- Yum
- Proxy
参考:https://help.sonatype.com/en/formats.html
Docker 部署
首先,创建数据文件夹并设置正确的权限(否则启动会报错),命令如下:
docker-compose.yml 配置如下:
启动命令如下:
稍等一会,默认密码请查看:cat [映射主机目录]/admin.password,然后,通过浏览器登录如下:
关闭 Outreach: Management
步骤:System -> Capabilities -> Outreach: Management -> Disabled
如果不进行调优操作,运行过程中,可能会报错如下:
2025-05-16 09:59:15,100+0800 INFO [pool-2-thread-1] anonymous org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://sonatype-download.global.ssl.fastly.net:443: Network is unreachable
2025-05-16 09:59:15,100+0800 INFO [pool-2-thread-1] anonymous org.apache.http.impl.execchain.RetryExec - Retrying request to {s}->https://sonatype-download.global.ssl.fastly.net:443
2025-05-16 09:59:35,120+0800 INFO [pool-2-thread-1] anonymous org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://sonatype-download.global.ssl.fastly.net:443: Network is unreachable
2025-05-16 09:59:35,120+0800 INFO [pool-2-thread-1] anonymous org.apache.http.impl.execchain.RetryExec - Retrying request to {s}->https://sonatype-download.global.ssl.fastly.net:443
2025-05-16 09:59:55,139+0800 WARN [pool-2-thread-1] anonymous com.sonatype.nexus.plugins.outreach.internal.outreach.SonatypeOutreach - Could not download page bundle
2025-05-28 10:41:05,758+0800 WARN [pool-2-thread-1] anonymous com.sonatype.nexus.plugins.outreach.internal.outreach.SonatypeOutreach - Could not download page bundle
org.apache.http.conn.ConnectTimeoutException: Connect to links.sonatype.com:443 [links.sonatype.com/3.130.138.154, links.sonatype.com/3.13.154.138, links.sonatype.com/18.224.75.160] failed: Connect timed out
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
参考:https://github.com/sonatype/nexus-public/issues/518 |
上一篇:【Playwright】(二)常用功能和操作
|