Skip to content

Commit 436faab

Browse files
authored
Merge pull request #9 from geographika/docker
Update notes on Docker
2 parents bef67cc + 54ef1b9 commit 436faab

3 files changed

Lines changed: 68 additions & 13 deletions

File tree

docker/Dockerfile

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.11.4 AS gdal
1+
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.12.2 AS gdal
22
# see https://github.com/OSGeo/gdal/tree/master/docker#ubuntu-based
33

44
FROM gdal AS builder
@@ -9,13 +9,43 @@ RUN --mount=type=cache,target=/var/cache,sharing=locked \
99
--mount=type=cache,target=/root/.cache \
1010
apt-get update \
1111
&& apt-get upgrade --assume-yes \
12-
&& DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --no-install-recommends bison \
13-
flex python3-lxml libfribidi-dev swig \
14-
cmake librsvg2-dev colordiff libpq-dev libpng-dev libjpeg-dev libgif-dev libgeos-dev libgd-dev \
15-
libfreetype6-dev libfcgi-dev libcurl4-gnutls-dev libcairo2-dev libxml2-dev \
16-
libxslt1-dev python3-dev python3-pip python3-setuptools python3-venv php-dev libexempi-dev lcov lftp ninja-build git curl \
17-
clang libprotobuf-c-dev protobuf-c-compiler libharfbuzz-dev libcairo2-dev librsvg2-dev \
18-
unixodbc-dev \
12+
&& DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --no-install-recommends \
13+
bison \
14+
flex \
15+
python3-lxml \
16+
libfribidi-dev \
17+
swig \
18+
cmake \
19+
librsvg2-dev \
20+
colordiff \
21+
libpq-dev \
22+
libpng-dev \
23+
libjpeg-dev \
24+
libgif-dev \
25+
libgeos-dev \
26+
libgd-dev \
27+
libfreetype6-dev \
28+
libfcgi-dev \
29+
libcurl4-gnutls-dev \
30+
libcairo2-dev \
31+
libxml2-dev \
32+
libxslt1-dev \
33+
python3-dev \
34+
php-dev \
35+
libexempi-dev \
36+
lcov \
37+
lftp \
38+
ninja-build \
39+
git \
40+
curl \
41+
clang \
42+
libprotobuf-c-dev \
43+
protobuf-c-compiler \
44+
libharfbuzz-dev \
45+
python3-pip \
46+
python3-setuptools \
47+
python3-venv \
48+
unixodbc-dev \
1949
&& ln -s /usr/lib/*-linux-gnu/libproj.so.*[0] $(echo /usr/lib/*-linux-gnu)/libproj.so
2050

2151
ARG MAPSERVER_BRANCH
@@ -37,7 +67,7 @@ RUN cmake .. \
3767
-DWITH_CLIENT_WMS=1 \
3868
-DWITH_CLIENT_WFS=1 \
3969
-DWITH_OGCAPI=1 \
40-
-DWITH_KML=0 \
70+
-DWITH_KML=1 \
4171
-DWITH_SOS=0 \
4272
-DWITH_XMLMAPFILE=0 \
4373
-DWITH_CAIRO=1 \
@@ -87,7 +117,7 @@ RUN a2enmod fcgid headers status \
87117
s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \
88118
' '{}' ';' \
89119
&& sed -ri 's!LogFormat "(.*)" combined!LogFormat "%{us}T %{X-Request-Id}i \1" combined!g' /etc/apache2/apache2.conf \
90-
&& echo 'ErrorLogFormat "%{X-Request-Id}i [%l] [pid %P] %M"' >> /etc/apache2/apache2.conf \
120+
&& echo 'ErrorLogFormat "%{X-Request-Id}i [%l] [pid %P] %M"' > /etc/apache2/conf-enabled/000-error-log-format.conf \
91121
&& sed -i -e 's/<VirtualHost \*:80>/<VirtualHost *:8080>/' /etc/apache2/sites-available/000-default.conf \
92122
&& sed -i -e 's/Listen 80$/Listen 8080/' /etc/apache2/ports.conf \
93123
&& rm -rf /etc/apache2/conf-enabled/other-vhosts-access-log.conf

docker/ReadMe.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Workshop attendees don't need to build these images themselves, they can simply
99
```
1010
start "C:\Program Files\Docker\Docker\Docker Desktop.exe"
1111
12-
# add --no-cache to the command below to force getting the latest code
1312
# can also test other repos / branches
1413
1514
cd D:\GitHub\getting-started-with-mapserver\docker
@@ -21,6 +20,15 @@ docker build `
2120
--build-arg=MAPSERVER_REPO=https://github.com/mapserver/mapserver `
2221
.
2322
23+
# add --no-cache to the command below to force getting the latest code
24+
docker build `
25+
--tag "mapserver-workshop" `
26+
--target=runner `
27+
--build-arg=MAPSERVER_BRANCH=main `
28+
--build-arg=MAPSERVER_REPO=https://github.com/mapserver/mapserver `
29+
--no-cache `
30+
.
31+
2432
# docker run -it --name mapserver-workshop -p 8080:8080 mapserver-workshop
2533
2634
docker tag mapserver-workshop geographika/mapserver-workshop
@@ -30,6 +38,14 @@ docker tag mapserver-workshop geographika/mapserver-workshop
3038
docker push geographika/mapserver-workshop
3139
```
3240

41+
If there are connection issues, try running the following test from the host, and check proxy/DNS settings:
42+
43+
```
44+
ping archive.ubuntu.com
45+
```
46+
47+
Also check https://status.canonical.com/
48+
3349
## Testing
3450

3551
```
@@ -61,9 +77,12 @@ docker tag mapserver-workshop-demo geographika/mapserver-workshop-demo
6177
# docker push geographika/mapserver-workshop-demo
6278
6379
# DigitalOcean
64-
doctl auth init
80+
# https://mapserver-workshop-k8hvw.ondigitalocean.app/
81+
# used for https://mapserver.github.io/getting-started-with-mapserver-demo/
82+
# Login and get a new API token with permissions for "registry"
83+
84+
doctl auth init -t dop_v1_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
6585
doctl registry login
6686
docker tag mapserver-workshop-demo registry.digitalocean.com/geographika/mapserver-workshop-demo:latest
6787
docker push registry.digitalocean.com/geographika/mapserver-workshop-demo:latest
68-
6988
```

workshop/exercises/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,10 @@ To view live logs:
3030

3131
```bash
3232
docker logs --follow mapserver
33+
```
34+
35+
To force getting the latest Docker images:
36+
37+
```bash
38+
docker compose up -d --pull always
3339
```

0 commit comments

Comments
 (0)