Skip to content

Commit

Permalink
Docker run script updates for rootless docker
Browse files Browse the repository at this point in the history
  • Loading branch information
elahrvivaz committed Apr 26, 2024
1 parent f8557d7 commit a208d62
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build/run-geoserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,18 @@ entrypoint="$entrypoint && echo 'tomcat.util.scan.StandardJarScanFilter.jarsToSk
# the default container entrypoint is 'catalina.sh run'
entrypoint="$entrypoint && exec catalina.sh run"

if ! docker network ls | grep -q geomesa; then
echo "Creating docker network"
docker network create geomesa
fi

echo "Starting geoserver"
# add-opens required by arrow for jdk 11+
# use ! to prevent exit on error as we want to always run the permissions cleanup step
# shellcheck disable=SC2251
! docker run --rm \
--name geoserver \
--network geomesa \
-p 8080:8080 -p 5005:5005 \
-v "$gs_war:/usr/local/tomcat/webapps/geoserver" \
-v "$data_dir:/tmp/data" \
Expand All @@ -202,7 +211,7 @@ echo "Starting geoserver"
"$image" \
-c "$entrypoint"

if [[ -z "$(docker info -f "{{println .SecurityOptions}}" | grep rootless)" ]]; then
if ! docker info -f "{{println .SecurityOptions}}" | grep -q rootless; then
# reset permissions on the datadir so that it doesn"t end up owned by tomcat
docker run --rm \
-v "$data_dir:/tmp/data" \
Expand Down

0 comments on commit a208d62

Please sign in to comment.