docker+nexus 搭建 nuget服务器

1、nexus安装

1.1 拉取镜像

docker pull sonatype/nexus3

1.2 创建容器

docker run -d -p 8081:8081 --name nexus -v /usr/local/xiaosheng/data/nexus/:/nexus-data sonatype/nexus3:latest

注意 -v后面的路径 需要文件夹权限

chmod 777 /usr/local/xiaosheng/data/nexus/

1.3 容器创建成功后,过一到两分钟后访问 http://192.168.99.157:8081/

 

 

1.4 登录

 

 

默认账号:admin

默认密码:密码所在目录为创建容器的-v参数 

vi /usr/local/xiaosheng/data/nexus/admin.password  

文件里的guid就是密码,登录后就会让填写新的密码,选择是否允许匿名访问等

此时nuget仓库已经搭建完成。

2、往刚刚搭建的nuget上上传包

2.1 下载上传工具 nuget.exe

下载地址:https://www.nuget.org/downloads

2.2 上传

nuget.exe push NuGetServer.1.0.2.nupkg  -Source http://192.168.99.157:8081/repository/nuget-hosted/

 

 3、在vs的nuget中新增地址,即可获取到了。

 

参考地址:https://www.cnblogs.com/subendong/p/14759969.html

posted @ 2022-03-12 09:31  RJXS  阅读(337)  评论(0)    收藏  举报