Skip to content

Commit 1afa2c8

Browse files
committed
Support for nightly builds
1 parent b470f78 commit 1afa2c8

File tree

4 files changed

+86
-13
lines changed

4 files changed

+86
-13
lines changed

BUILD.md

+64
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,67 @@ docker build \
5454
--build-arg ADDITIONAL_LIBS_PATH={RELATIVE_PATH_TO_YOUR_LIBS}
5555
-t {YOUR_TAG} .
5656
```
57+
58+
## How to build from nightly snapshot releases?
59+
60+
By default ``WAR_ZIP_URL``, ``STABLE_PLUGIN_URL`` make use of sourceforge downloads to obtain official releases.
61+
62+
Override these arguments to make use of build.geoserver.org nightly releases:
63+
64+
* ``--build-arg WAR_ZIP_URL=https://build.geoserver.org/geoserver/${GS_VERSION}/geoserver-${GS_VERSION}-latest-war.zip``
65+
* ``--build-arg STABLE_PLUGIN_URL=https://build.geoserver.org/geoserver/${GS_VERSION}/ext-latest/``
66+
* ``--build-arg COMMUNITY_PLUGIN_URL=https://build.geoserver.org/geoserver/${GS_VERSION}/community-latest/``
67+
68+
69+
Here is a working example for building 2.23.x nightly build::
70+
```
71+
docker build \
72+
--build-arg WAR_ZIP_URL=https://build.geoserver.org/geoserver/2.23.x/geoserver-2.23.x-latest-war.zip \
73+
--build-arg STABLE_PLUGIN_URL=https://build.geoserver.org/geoserver/2.23.x/ext-latest/ \
74+
--build-arg COMMUNITY_PLUGIN_URL=https://build.geoserver.org/geoserver/2.23.x/community-latest/ \
75+
--build-arg GS_VERSION=2.23-SNAPSHOT \
76+
-t 2.23.x .
77+
```
78+
79+
When running both stable extensions and community modules can be included:
80+
81+
```
82+
docker run -it -p 80:8080 \
83+
--env INSTALL_EXTENSIONS=true \
84+
--env STABLE_EXTENSIONS="ysld" \
85+
--env COMMUNITY_EXTENSIONS="ogcapi" \
86+
-t 2.23.x
87+
```
88+
89+
Community modules are only available for nightly builds as they have not yet met the requirements for production use. Developers have shared these to attract participation, feedback and funding.
90+
91+
## How to build from main snapshot releases?
92+
93+
The build.geoserver.org output for the ``main`` branch requires the following:
94+
95+
* ``--build-arg WAR_ZIP_URL=https://build.geoserver.org/geoserver/main/geoserver-main-latest-war.zip``
96+
* ``--build-arg STABLE_PLUGIN_URL=https://build.geoserver.org/geoserver/main/ext-latest/``
97+
* ``--build-arg COMMUNITY_PLUGIN_URL=https://build.geoserver.org/geoserver/main/community-latest/``
98+
99+
100+
Here is a working example for building main branch as 2.24.x build:
101+
102+
```
103+
docker build \
104+
--build-arg WAR_ZIP_URL=https://build.geoserver.org/geoserver/main/geoserver-main-latest-war.zip \
105+
--build-arg STABLE_PLUGIN_URL=https://build.geoserver.org/geoserver/main/ext-latest/ \
106+
--build-arg COMMUNITY_PLUGIN_URL=https://build.geoserver.org/geoserver/main/community-latest/ \
107+
--build-arg GS_VERSION=2.24-SNAPSHOT \
108+
-t 2.24.x .
109+
```
110+
111+
When running both [stable extensions](https://build.geoserver.org/geoserver/main/ext-latest/) and [community modules](https://build.geoserver.org/geoserver/main/community-latest/) can be included:
112+
113+
```
114+
docker run -it -p 80:8080 \
115+
--env INSTALL_EXTENSIONS=true \
116+
--env STABLE_EXTENSIONS="wps,css" \
117+
--env COMMUNITY_EXTENSIONS="ogcapi-coverages,ogcapi-dggs,ogcapi-features,ogcapi-images,ogcapi-maps,ogcapi-styles,ogcapi-tiled-features,ogcapi-tiles" \
118+
-t 2.24.x
119+
```
120+

Dockerfile

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
FROM ubuntu:22.04
22

33
# The GS_VERSION argument could be used like this to overwrite the default:
4-
# docker build --build-arg GS_VERSION=2.21.2 -t geoserver:2.21.2 .
5-
ARG TOMCAT_VERSION=9.0.68
6-
ARG GS_VERSION=2.22.0
4+
# docker build --build-arg GS_VERSION=2.23.0 -t geoserver:2.23.0 .
5+
ARG TOMCAT_VERSION=9.0.74
6+
ARG GS_VERSION=2.23.0
77
ARG GS_DATA_PATH=./geoserver_data/
88
ARG ADDITIONAL_LIBS_PATH=./additional_libs/
99
ARG ADDITIONAL_FONTS_PATH=./additional_fonts/
1010
ARG CORS_ENABLED=false
1111
ARG CORS_ALLOWED_ORIGINS=*
1212
ARG CORS_ALLOWED_METHODS=GET,POST,PUT,DELETE,HEAD,OPTIONS
1313
ARG CORS_ALLOWED_HEADERS=*
14+
ARG WAR_ZIP_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${GS_VERSION}/geoserver-${GS_VERSION}-war.zip
1415
ARG STABLE_PLUGIN_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${GS_VERSION}/extensions
16+
ARG COMMUNITY_PLUGIN_URL=''
1517

1618
# Environment variables
1719
ENV CATALINA_HOME=/opt/apache-tomcat-${TOMCAT_VERSION}
@@ -26,8 +28,11 @@ ENV CORS_ALLOWED_METHODS=$CORS_ALLOWED_METHODS
2628
ENV CORS_ALLOWED_HEADERS=$CORS_ALLOWED_HEADERS
2729
ENV DEBIAN_FRONTEND=noninteractive
2830
ENV INSTALL_EXTENSIONS=false
31+
ENV WAR_ZIP_URL=$WAR_ZIP_URL
2932
ENV STABLE_EXTENSIONS=''
3033
ENV STABLE_PLUGIN_URL=$STABLE_PLUGIN_URL
34+
ENV COMMUNITY_EXTENSIONS=''
35+
ENV COMMUNITY_PLUGIN_URL=$COMMUNITY_PLUGIN_URL
3136
ENV ADDITIONAL_LIBS_DIR=/opt/additional_libs/
3237
ENV ADDITIONAL_FONTS_DIR=/opt/additional_fonts/
3338
ENV SKIP_DEMO_DATA=false
@@ -63,7 +68,7 @@ RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-9/v${TOMCAT_VERSION}/b
6368
WORKDIR /tmp
6469

6570
# install geoserver
66-
RUN wget -q -O /tmp/geoserver.zip https://downloads.sourceforge.net/project/geoserver/GeoServer/$GEOSERVER_VERSION/geoserver-$GEOSERVER_VERSION-war.zip && \
71+
RUN wget -q -O /tmp/geoserver.zip $WAR_ZIP_URL && \
6772
unzip geoserver.zip geoserver.war -d $CATALINA_HOME/webapps && \
6873
mkdir -p $CATALINA_HOME/webapps/geoserver && \
6974
unzip -q $CATALINA_HOME/webapps/geoserver.war -d $CATALINA_HOME/webapps/geoserver && \

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ This README.md file covers use of official docker image, additional [build](BULD
1818
To pull an official image use ``docker.osgeo.org/geoserver:{{VERSION}}``, e.g.:
1919

2020
```shell
21-
docker pull docker.osgeo.org/geoserver:2.22.0
21+
docker pull docker.osgeo.org/geoserver:2.23.0
2222
```
2323

2424
Afterwards you can run the pulled image locally with:
2525

2626
```shell
27-
docker run -it -p 80:8080 docker.osgeo.org/geoserver:2.22.0
27+
docker run -it -p 80:8080 docker.osgeo.org/geoserver:2.23.0
2828
```
2929

3030
Or if you want to start the container daemonized, use e.g.:
3131

3232
```shell
33-
docker run -d -p 80:8080 docker.osgeo.org/geoserver:2.22.0
33+
docker run -d -p 80:8080 docker.osgeo.org/geoserver:2.23.0
3434
```
3535

3636
Check <http://localhost/geoserver> to see the geoserver page,
@@ -47,7 +47,7 @@ To use an external folder as your geoserver data directory.
4747
```shell
4848
docker run -it -p 80:8080 \
4949
--mount src="/absolute/path/on/host",target=/opt/geoserver_data/,type=bind \
50-
docker.osgeo.org/geoserver:2.22.0
50+
docker.osgeo.org/geoserver:2.23.0
5151
```
5252

5353
An empty data directory will be populated on first use. You can easily update GeoServer while
@@ -62,7 +62,7 @@ The environment variable `SKIP_DEMO_DATA` can be set to `true` to create an empt
6262
```shell
6363
docker run -it -p 80:8080 \
6464
--env SKIP_DEMO_DATA=true \
65-
docker.osgeo.org/geoserver:2.22.0
65+
docker.osgeo.org/geoserver:2.23.0
6666
```
6767

6868
## How to issue a redirect from the root ("/") to GeoServer web interface ("/geoserver/web")?
@@ -83,7 +83,7 @@ Example installing wps and ysld extensions:
8383
```shell
8484
docker run -it -p 80:8080 \
8585
--env INSTALL_EXTENSIONS=true --env STABLE_EXTENSIONS="wps,ysld" \
86-
docker.osgeo.org/geoserver:2.22.0
86+
docker.osgeo.org/geoserver:2.23.0
8787
```
8888

8989
The list of extensions (taken from SourceForge download page):
@@ -108,7 +108,7 @@ If you want to add geoserver extensions/libs, place the respective jar files in
108108
```shell
109109
docker run -it -p 80:8080 \
110110
--mount src="/dir/with/libs/on/host",target=/opt/additional_libs,type=bind \
111-
docker.osgeo.org/geoserver:2.22.0
111+
docker.osgeo.org/geoserver:2.23.0
112112
```
113113

114114
## How to add additional fonts to the docker image (e.g. for SLD styling)?
@@ -118,7 +118,7 @@ If you want to add custom fonts (the base image only contains 26 fonts) by using
118118
```shell
119119
docker run -it -p 80:8080 \
120120
--mount src="/dir/with/fonts/on/host",target=/opt/additional_fonts,type=bind \
121-
docker.osgeo.org/geoserver:2.22.0
121+
docker.osgeo.org/geoserver:2.23.0
122122
```
123123

124124
**Note:** Do not change the target value!

install-extensions.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ if [ "$INSTALL_EXTENSIONS" = "true" ]; then
2828
URL="${STABLE_PLUGIN_URL}/geoserver-${GEOSERVER_VERSION}-${EXTENSION}-plugin.zip"
2929
download_extension ${URL} ${EXTENSION}
3030
done
31+
for EXTENSION in $(echo "${COMMUNITY_EXTENSIONS}" | tr ',' ' '); do
32+
URL="${COMMUNITY_PLUGIN_URL}/geoserver-${GEOSERVER_VERSION}-${EXTENSION}-plugin.zip"
33+
download_extension ${URL} ${EXTENSION}
34+
done
3135
echo "Finished download of extensions"
3236
fi
3337

3438
# Install the extensions
3539
echo "Starting installation of extensions"
36-
for EXTENSION in $(echo "${STABLE_EXTENSIONS}" | tr ',' ' '); do
40+
for EXTENSION in $(echo "${STABLE_EXTENSIONS},${COMMUNITY_EXTENSIONS}" | tr ',' ' '); do
3741
ADDITIONAL_LIB=${ADDITIONAL_LIBS_DIR}geoserver-${GEOSERVER_VERSION}-${EXTENSION}-plugin.zip
3842
[ -e "$ADDITIONAL_LIB" ] || continue
3943

0 commit comments

Comments
 (0)