idoop / docker-nuget-server

Build simple-nuget-server docker image.
https://hub.docker.com/r/idoop/docker-nuget-server/
MIT License
28 stars 10 forks source link
dockerfile nuget-server shell

docker-nuget-server

Docker Build Status Docker Automated build Docker Pulls ImageLayers Size

Auto build docker image for simple-nuget-server

Quick start

docker command

docker run -d --name nuget-server -p 80:80 -e NUGET_API_KEY="112233" idoop/docker-nuget-server

docker-compose

version: '2'
services:
  nuget-server:
    container_name: nuget-server
    image: idoop/docker-nuget-server:latest
    network_mode: "host"
    restart: always
    environment:
      NUGET_API_KEY: "112233"
      UPLOAD_MAX_FILESIZE: "40M"

      ## When use host network mode, 
      ## set SERVER_PORT value if you want change server expose port.
      # SERVER_PORT: "8080"

      ## Set nuget server domain[:port], also you can use machine(not container) ip[:port]. 
      ## eg: "192.168.11.22:8080" or "nuet.eg.com:8080"
      SERVER_NAME: "nuget.example.com"
      WORKER_PROCESSES: "2"
    volumes:
      - nuget-db:/var/www/simple-nuget-server/db
      - nuget-packagefiles:/var/www/simple-nuget-server/packagefiles
      - nuget-nginx:/etc/nginx
    ulimits:
      nproc: 8096
      nofile:
        soft: 65535
        hard: 65535
volumes:
  nuget-db:
  nuget-packagefiles:
  nuget-nginx:

Note: make sure your Host feed available on either port 80.

Environment configuration

Volumes

Test

Download nuget commandline tool.

Push nuget package:

nuget push xxx.nupkg -source SERVER_NAME -apikey NUGET_API_KEY

Download nuget package:

nuget install xxx -source SERVER_NAME -packagesavemode nupkg

Bug:

If not set SERVER_NAME value ,client will resolve the default server name localhost at client machine.