A simple NuGet server written in PHP
5M+
This project provides a NuGet feed based on the simple-nuget-server project. It runs on top of the official nginx image and uses HHVM for PHP execution. Supervisor is used for tracking the processes.
The corresponding docker image is sunside/simple-nuget-server and can be found here.
docker run --detach=true \
--publish 5000:80 \
--env NUGET_API_KEY=<your secret> \
--volume /srv/docker/nuget/database:/var/www/db \
--volume /srv/docker/nuget/packages:/var/www/packagefiles \
--name nuget-server \
sunside/simple-nuget-server
To build the image named simple-nuget-server, execute the following command:
docker build -t simple-nuget-server .
At build time, a random API key is generated and printed out to the console. Note that this implies that every new image has a different default API key.
Make sure to have the submodule available by either cloning with git clone --recursive or executing
git submodule init
git submodule update
To run a container off the simple-nuget-server image, execute the following command:
docker run -d --name nuget-server -p 80:80 \
-e NUGET_API_KEY=<your secret> simple-nuget-server
Note that some NuGet clients might be picky about the port, so be sure to have your feed available on either port 80 or 443, e.g. by having a reverse proxy in front on the container.
NUGET_API_KEY sets the NuGet feed's API key to your own private keyBASE_URL sets the base path of the feed, e.g. /nuget if it is available under http://your.tld/nuget//var/www/db contains the SQLite database/var/www/packagefiles contains uploaded the NuGet packages/var/cache/nginx nginx' cache filesIn order to push a package to your new NuGet feed, use the following command:
nuget push -src http://url.to/your/feed/ -ApiKey <your secret> path/to/package.nupkg
You can add your feed to a specific NuGet.config file using:
nuget sources add -Name "Your Feed's Name" -Source http://url.to/your/feed/ -ConfigFile NuGet.config
In order to store the API key in a specifig NuGet.config file you can use:
nuget setapikey -Source http://url.to/your/feed/ -ConfigFile NuGet.config
This will create or update the apikeys section of your configuration file. Make sure to not check anything sensitive into source control.
In both cases, if you omit the -ConfigFile <file> option, your user configuration file will be used.
This project is licensed under the MIT license. See the LICENSE file for more information.
Content type
Image
Digest
sha256:9b1be6317…
Size
145 MB
Last updated
over 10 years ago
docker pull sunside/simple-nuget-server