geosolutions-it/docker-geoserver

Build of docker image for GeoServer 2.22.4 is failing

Closed this issue · 4 comments

There's a problem in the build during the download of the war file from SourceForge. The link is working fine in the browser.
It needs to be debugged by building the image locally

2023-06-22T09:23:03Z #10 https://netcologne.dl.sourceforge.net/project/geoserver/GeoServer/2.22.4/geoserver-2.22.4-war.zip
2023-06-22T09:23:03Z #10 DONE 0.6s
2023-06-22T09:23:03Z
2023-06-22T09:23:03Z #11 [mother 6/15] ADD https://netcologne.dl.sourceforge.net/project/geoserver/GeoServer/2.22.4/geoserver-2.22.4-war.zip ./
2023-06-22T09:23:03Z #11 DONE 0.2s
2023-06-22T09:23:03Z
2023-06-22T09:23:03Z #12 [mother 7/15] RUN if [ -f "./download" ] ; then mv download geoserver.war.zip && unzip geoserver.war.zip -d geoserver.war && mkdir -p ./geoserver && unzip ./geoserver.war/geoserver.war -d ./geoserver && rm -rf ./geoserver.war; fi
2023-06-22T09:23:04Z #12 DONE 0.5s
2023-06-22T09:23:04Z
2023-06-22T09:23:04Z #13 [mother 8/15] RUN if [ "${GEOSERVER_WEBAPP_SRC##*.}" = "zip" ]; then unzip "./*zip"; rm ./*zip; fi && [ -d "./geoserver" ] || (mkdir -p ./geoserver && unzip ./geoserver.war -d ./geoserver && rm ./geoserver.war)
2023-06-22T09:23:04Z #13 0.508 Archive: ./geoserver-2.22.4-war.zip
2023-06-22T09:23:04Z #13 0.508 End-of-central-directory signature not found. Either this file is not
2023-06-22T09:23:04Z #13 0.508 a zipfile, or it constitutes one disk of a multi-part archive. In the
2023-06-22T09:23:04Z #13 0.508 latter case the central directory and zipfile comment will be found on
2023-06-22T09:23:04Z #13 0.508 the last disk(s) of this archive.
2023-06-22T09:23:04Z #13 0.508 unzip: cannot find zipfile directory in one of ./*zip or
2023-06-22T09:23:04Z #13 0.508 ./*zip.zip, and cannot find ./geoserver-2.22.4-war.zip.ZIP, period.

docker build --build-arg GEOSERVER_WEBAPP_SRC=https://netcologne.dl.sourceforge.net/project/geoserver/GeoServer/2.22.4/geoserver-2.22.4-war.zip --build-arg PLUG_IN_PATHS=./resources/geoserver-plugins -f Dockerfile -t index.docker.io/geosolutionsit/geoserver:2.22.4 .

The Dockerfile ADD statement is not following the URL redirect on Sourceforge and is downloading an HTML page instead of the zip file

Image

We may want to try with a RUN of wget / curl instead of the ADD $URL. The is documentation available here: https://sourceforge.net/p/forge/documentation/Downloading%20files%20via%20the%20command%20line/

Due to how the docker build is configured on docker hub which rebuilds also the docker images for older versions of geoserver we must be very careful not to break the other docker images already pushed to the Hub.

I would actually change the way the images are built. It's too cumbersome, fragile and hard to maintain

New PR with the fixed URLs tested on the docker hub build:
#119

Build is now green, docker images pulled and tested.

I put to run the docker build for the newest-version branch:
https://hub.docker.com/repository/registry-1.docker.io/geosolutionsit/geoserver/builds/fcb2e3f1-f8eb-405c-90eb-bb7d32e5e03e

I tested this using docker pull locally and run the images, access to geoserver using admin, and preview several layers from the default catalog.

docker pull geosolutionsit/geoserver:2.23.1
docker run -p 8080:8080 geosolutionsit/geoserver:2.23.1
docker pull geosolutionsit/geoserver:2.22.4
docker run -p 8080:8080 geosolutionsit/geoserver:2.22.4

Addressed by #121

Thanks @fernandor777