Fix WS Container Image
Current builds of WS image (Dockerfile-ws
) produce an image which does not run as expected.
To Reproduce
- Build the docker image...
docker build --no-cache --pull -t geoserve -f Dockerfile-ws .
Note: Including
--no-cache
and--pull
to ensure a fresh build from remote base images. May optionally includeFROM_IMAGE
andBUILD_IMAGE
to pull from internal registry.
- Start the docker image...
docker run --rm -p 3000:80 geoserve
- Connect to the running container via a browser: http://localhost:3000/ws/geoserve/
Expected Result
A 200 response with a page that looks something like the following image:
Actual Result
An HTTP 500 error response. Server logs should output something as follows:
[Tue Dec 08 20:01:26.583039 2020] [php7:warn] [pid 10] [client 172.17.0.1:35118] PHP Warning: include_once(functions.inc.php): failed to open stream: No such file or directory in /var/www/apps/hazdev-geoserve-ws/lib/data/metadata.inc.php on line 3
[Tue Dec 08 20:01:26.583141 2020] [php7:warn] [pid 10] [client 172.17.0.1:35118] PHP Warning: include_once(): Failed opening 'functions.inc.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/apps/hazdev-geoserve-ws/lib/data/metadata.inc.php on line 3
[Tue Dec 08 20:01:26.597105 2020] [php7:error] [pid 10] [client 172.17.0.1:35118] PHP Fatal error: Uncaught Error: Call to undefined function param() in /var/www/apps/hazdev-geoserve-ws/lib/data/metadata.inc.php:19\nStack trace:\n#0 /var/www/apps/hazdev-geoserve-ws/htdocs/index.php(5): include_once()\n#1 {main}\n thrown in /var/www/apps/hazdev-geoserve-ws/lib/data/metadata.inc.php on line 19
- - - [08/Dec/2020:20:01:26 +0000] "GET /ws/geoserve/ HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" "-" 172.17.0.1
Possible Resolutions
The error logs suggest the template is not being properly installed/configured. A php.ini
file is generated as part of the hazdev-template pre-install.php script; similarly, Apache directives attempt to update the include path for template resources. Neither seem to work as intended.