自己搭建私有nuget服务器
1.安装nuget服务
docker run -d -p 8080:80 -v E:/Docker/nuget/db:/var/www/db -v E:/Docker/nuget/packages:/var/www/packagefiles -e NUGET_API_KEY=yourkey sunside/simple-nuget-server
2.打包:
dotnet pack -property:Configuration=Release -o packages o-路径
<PropertyGroup>
<PackageId>AppLogger</PackageId>
<Version>1.0.0</Version>
<Authors>your_name</Authors>
<Company>your_company</Company>
</PropertyGroup>
3.推送:
dotnet nuget push --source http://127.0.0.1:8080/ -k weilai xxxxx.nupkg
ee28314c-f7fe-2550-bd77-e09eda3d0119 --localdocker
dotnet nuget push --source http://:8080/ -k yourkey Weilai.Extensions.1.4.5.nupkg
4、示例
自己搭建私有nuget服务器
1.运行镜像,docker run -d -p 8080:80 -v E:/Docker/nuget/db:/var/www/db -v E:/Docker/nuget/packages:/var/www/packagefiles -e NUGET_API_KEY=yourkey sunside/simple-nuget-server
2.打包:
dotnet pack -property:Configuration=Release -o packages o-路径
<PropertyGroup>
<PackageId>AppLogger</PackageId>
<Version>1.0.0</Version>
<Authors>your_name</Authors>
<Company>your_company</Company>
</PropertyGroup>
3.推送:dotnet nuget push --source http://127.0.0.1:8080/ -k weilai xxxxx.nupkg
ee28314c-f7fe-2550-bd77-e09eda3d0119 --localdocker
dotnet nuget push --source http://:8080/ -k yourkey Weilai.Extensions.1.4.5.nupkg
https://www.cnblogs.com/liuxiaoji/p/11083136.html --自动推送
Baget也可以实现
https://loic-sharma.github.io/BaGet/installation/docker/
1、配置文件 Create a file named baget.env
to store BaGet's configurations:
# The following config is the API Key used to publish packages.
# You should change this to a secret value to secure your server.
ApiKey=NUGET-SERVER-API-KEY
Storage__Type=FileSystem
Storage__Path=/var/baget/packages
Database__Type=Sqlite
Database__ConnectionString=Data Source=/var/baget/baget.db
Search__Type=Database
2、docker 安装,push nuget包
docker pull loicsharma/baget
docker run --rm --name nuget-server -p 5555:80 --env-file baget.env -v "$(pwd)/baget-data:/var/baget" loicsharma/baget:latest
docker run -d --rm --name nuget-server -p 2028:80 --env-file /volume1/docker/nuget/baget/env.ini -v "/volume1/docker/nuget/baget:/var/baget" loicsharma/baget:latest (群辉)
dotnet nuget push -s http://localhost:5555/v3/index.json -k NUGET-SERVER-API-KEY package.1.0.0.nupkg
评论区