为什么要自建 pip 源?
在企业或内网环境中,常见需求:
❌ 无法访问公网 PyPI(如安全隔离网络)
⏳ 安装包太慢(pip 下载慢)
🔐 需要统一管理第三方包或发布内部私有库
📦 缓存常用包,避免重复下载
👉 解决方案:搭建私有 pip 源
而 Nexus 是目前最流行的通用仓库管理工具,支持:
✅ Python (PyPI)
✅ npm
✅ Maven
✅ Docker
✅ Helm 等
官网下载:https://www.sonatype.com/download-oss-sonatype
- 使用Docker Nexus搭建私有pip源完整指南## 标题
- 使用Docker部署Nexus
# 创建数据卷(持久化存储)
docker volume create nexus-data
# 启动Nexus容器
docker run -d \
--name nexus3 \
--restart=always \
-p 38081:8081 \
-v nexus-data:/nexus-data \
sonatype/nexus3
1.2 使用docker-compose部署(推荐)
version: '3'
services:
nexus:
image: sonatype/nexus3:latest
container_name: nexus3
restart: always
ports:
- "38081:8081"
volumes:
- nexus-data:/nexus-data
environment:
- INSTALL4J_ADD_VM_PARAMS=-Xms2g -Xmx2g -XX:MaxDirectMemorySize=3g
volumes:
nexus-data:
启动服务:docker-compose up -d
查看初始密码
# 查看初始密码
docker exec nexus3 cat /nexus-data/admin.password
# 或者
docker-comp

最低0.47元/天 解锁文章
712

被折叠的 条评论
为什么被折叠?



