使用Docker 快速搭建nuget本地服务器,Hosting private nuget server using docker in seconds!...

Server

#below line automatically creates the folder, mount the volumes and maps the ports.
docker run -d  -p 8080:80 -v F:/Apps/Docker/nuget/db:/var/www/db -v F:/Apps/Docker/nuget/packages:/var/www/packagefiles  -e NUGET_API_KEY=ee28314c-f7fe-2550-bd77-e09eda3d0119  sunside/simple-nuget-server
#If mapping directory meeting with errors, try using container directory directly inside of it to ensure running.

Then you get the local nuget server running at: http://localhost:8080
325785-20190115110350903-1715649350.png

Client CLI using choco

choco install -y Nuget.CommandLine
# After nuget installation:
dotnet pack -c Release
nuget push -Source http://localhost:8080/ -ApiKey ee28314c-f7fe-2550-bd77-e09eda3d0119 ClassLibrary.1.0.0.nupkg
#If using dotnet core on Linux, just use below, haven't found a way to check whether a package exists on nuget server
dotnet nuget delete --source http://192.168.1.7:17071/ -k 3cdb9803-86f9-4750-9615-338f14f0c814 --non-interactive EP.${fragment} 1.0.0
dotnet nuget push --source http://192.168.1.7:17071/ -k 3cdb9803-86f9-4750-9615-338f14f0c814 EP.${fragment}.1.0.0.nupkg

Most often package is successfully pushed to server.
In visual studio, add http://localhost:8080 to nuget package source.
Then:
325785-20190115132051814-1185411325.png
Package can be seen in nuget client gui.
Dont't forget to do the same to all its dependencies, and if other nuget packages referenced, remember to check the api.nuget.org source too.
325785-20190115134206868-226216068.png
Then add the package and build:
325785-20190115134338251-487342093.png

Below picture looks kind of encouraging!:))

325785-20190115153551876-472297097.png

转载于:https://www.cnblogs.com/hualiu0/p/10270773.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值