idoop / docker-nuget-server Goto Github PK
View Code? Open in Web Editor NEWBuild simple-nuget-server docker image.
Home Page: https://hub.docker.com/r/idoop/docker-nuget-server/
License: MIT License
Build simple-nuget-server docker image.
Home Page: https://hub.docker.com/r/idoop/docker-nuget-server/
License: MIT License
I was able to install this into my k8s environment and ultimately pushed some nupkg files to it. Calling the V2 api I'm able to list all the packages also. The problem occurs when I try to install these packages.
My Visual Studio 2017 reads them in Package Manager and it seem slike they're installable but I encounter this error:
The feed 'Scenario Manager Common [http://sm-dev.kubeodc.corp.intranet/nuget]' lists package 'ScenarioManager.Common.Utilities.1.0.0.48946' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again.
019/09/11 02:59:59 [error] 34#34: *17 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [14] unable to open database file in /var/www/simple-nuget-server/inc/db.php:10
Stack trace:
#0 /var/www/simple-nuget-server/inc/db.php(10): PDO->__construct('sqlite:../db/pa...', NULL, NULL)
#1 /var/www/simple-nuget-server/inc/db.php(386): DB::init()
#2 /var/www/simple-nuget-server/inc/core.php(3): require('/var/www/simple...')
#3 /var/www/simple-nuget-server/public/index.php(2): require('/var/www/simple...')
#4 {main}
thrown in /var/www/simple-nuget-server/inc/db.php on line 10" while reading response header from upstream, client: 192.168.0.121, server: nuget.ivilson.com:80, request: "PUT /api/v2/package/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "nuget.ivilson.com"
192.168.0.121 - - [11/Sep/2019:02:59:59 +0000] "PUT /api/v2/package/ HTTP/1.1" 500 5 "-" "NuGet Command Line/5.2.0 (Microsoft Windows NT 6.2.9200.0)" "220.173.39.41"
2019/09/11 02:59:59 [error] 34#34: *17 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [14] unable to open database file in /var/www/simple-nuget-server/inc/db.php:10
Stack trace:
#0 /var/www/simple-nuget-server/inc/db.php(10): PDO->__construct('sqlite:../db/pa...', NULL, NULL)
#1 /var/www/simple-nuget-server/inc/db.php(386): DB::init()
#2 /var/www/simple-nuget-server/inc/core.php(3): require('/var/www/simple...')
#3 /var/www/simple-nuget-server/public/index.php(2): require('/var/www/simple...')
#4 {main}
thrown in /var/www/simple-nuget-server/inc/db.php on line 10" while reading response header from upstream, client: 192.168.0.121, server: nuget.ivilson.com:80, request: "PUT /api/v2/package/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "nuget.ivilson.com"
192.168.0.121 - - [11/Sep/2019:02:59:59 +0000] "PUT /api/v2/package/ HTTP/1.1" 500 5 "-" "NuGet Command Line/5.2.0 (Microsoft Windows NT 6.2.9200.0)" "220.173.39.41"
2019/09/11 03:00:00 [error] 34#34: *17 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [14] unable to open database file in /var/www/simple-nuget-server/inc/db.php:10
Stack trace:
#0 /var/www/simple-nuget-server/inc/db.php(10): PDO->__construct('sqlite:../db/pa...', NULL, NULL)
#1 /var/www/simple-nuget-server/inc/db.php(386): DB::init()
#2 /var/www/simple-nuget-server/inc/core.php(3): require('/var/www/simple...')
#3 /var/www/simple-nuget-server/public/index.php(2): require('/var/www/simple...')
#4 {main}
thrown in /var/www/simple-nuget-server/inc/db.php on line 10" while reading response header from upstream, client: 192.168.0.121, server: nuget.ivilson.com:80, request: "PUT /api/v2/package/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "nuget.ivilson.com"
192.168.0.121 - - [11/Sep/2019:03:00:00 +0000] "PUT /api/v2/package/ HTTP/1.1" 500 5 "-" "NuGet Command Line/5.2.0 (Microsoft Windows NT 6.2.9200.0)" "220.173.39.41"
If you set the BASE_URL
env value the following script will be executed in https://github.com/idoop/docker-nuget-server/blob/master/docker-entrypoint
if [ -n "${BASE_URL}" ];then
echo "Use base URL: ${BASE_URL}"
sed -i -e "/fastcgi_temp_file_write_size.*$/a\ fastcgi_param BASE_URL ${BASE_URL};" /etc/nginx/conf.d/nuget.conf
fi
This creates new entries on every reboot of the containers and eventually your nginx.conf file will look like this
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_buffers 4 1024k;
fastcgi_buffer_size 1024k;
fastcgi_busy_buffers_size 1024k;
fastcgi_temp_file_write_size 5M;
fastcgi_param BASE_URL https://domain.tld/;
fastcgi_param BASE_URL https://domain.tld/;
fastcgi_param BASE_URL https://domain.tld/;
...
fastcgi_param BASE_URL https://domain.tld/;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location = /index.php {
dav_methods PUT DELETE;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_buffers 4 1024k;
fastcgi_buffer_size 1024k;
fastcgi_busy_buffers_size 1024k;
fastcgi_temp_file_write_size 5M;
fastcgi_param BASE_URL https://domain.tld/;
fastcgi_param BASE_URL https://domain.tld/;
fastcgi_param BASE_URL https://domain.tld/;
....
fastcgi_param BASE_URL https://domain.tld/;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
# PHP doesn't parse request body for PUT requests, so fake a POST.
fastcgi_param REQUEST_METHOD POST;
fastcgi_param HTTP_X_METHOD_OVERRIDE $request_method;
}
Hi,
When mounting volumes like [My/path]:[/var/www/something] the application crashes. After investigating for a good while, it is because it fails to create the database. What I notice is that when I run it without mounting external volumes, the "/var/www/something" folder has owner and group www-data but when mounting, it is root.
If I run docker exec bash and modify permissions, then the app is able to create the database.
Starting container new with docker-compose will result in port added with each start.
artifacts-nuget | 2021/03/05 11:00:11 [emerg] 32#32: invalid port in "808080" of the "listen" directive in /etc/nginx/conf.d/nuget.conf:6
artifacts-nuget | nginx: [emerg] invalid port in "808080" of the "listen" directive in /etc/nginx/conf.d/nuget.conf:6
artifacts-nuget | 2021/03/05 11:00:26 [emerg] 30#30: invalid port in "8080808080" of the "listen" directive in /etc/nginx/conf.d/nuget.conf:6
artifacts-nuget | nginx: [emerg] invalid port in "8080808080" of the "listen" directive in /etc/nginx/conf.d/nuget.conf:6
Next and so on...
If you set the SERVER_PORT env value the following script will be executed in https://github.com/idoop/docker-nuget-server/blob/master/docker-entrypoint
sed -i -e "s/listen 80/listen ${SERVER_PORT}/" /etc/nginx/conf.d/nuget.conf
I set SERVER_PORT
to 8080 and restarted the container. The nuget server listened on port 8080 as expected.
I set SERVER_PORT
back to 80 and restarted the container. The nuget server still listened on port 8080 and was not reachable anymore.
I'm hosting the idoop/docker-nuget-server image on Azure and am trying to install an uploaded image. This doesn;t work ad i get an "invalid port" error.
relevant configuration in app service config:
publishing an image and finding it works without an issue. But installing the module is trying to retrieve the package from port 80 instead of 443.
manually going to the same url with 443 works.
setting the environment variable to 443 breaks the container and it wont start anymore.
I am trying to run the NuGet server on a machine which already has port 80 in use. A typical docker approach is to allow me to provide -p 81:80 however the NuGet server provides URLs of packages which are then located on port 80 which fails.
I tried adding '-e SERVER_PORT=81 -p 81:81 --network=host' to my Docker run command however this seemed to make no difference.
I guess another approach could be to put NuGet behind a reverse proxy at /nuget on port 80 however there is no way to configure NuGet to work on this path.
Has the compose file/image been tested against SERVER_NAME variables other than 'localhost' and '127.0.0.1'? The 'nuget install' command via any other server name results in a 403 forbidden error regardless of if it is an IP or a domain name and regardless of if the command is run on the same host as the container or a different host.
nuget install -source http://x.x.x.x -packagesavemode nupkg
WARNING: The remote server returned an error: (403) Forbidden.
WARNING: An error occurred while loading packages from 'http:/x.x.x.x/': The remote server returned an error: (403) Forbidden.
change route to:
rewrite ^/search/$ /search.php;
then it would be accesable with http://localhost/search/
docker-nuget-server/nginx.conf.example
Line 17 in 1a62425
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.