Skip to content
Snippets Groups Projects

Upgrade to ubuntu 24.04 and mapserver 8.2

Merged David Hoese requested to merge update-deps into master
5 files
+ 72
220
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 42
51
FROM ubuntu:20.04
FROM ubuntu:24.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=GMT
@@ -7,15 +7,13 @@ ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
RUN apt-get update && apt-get install -y \
gosu \
pwgen \
tzdata \
gcc \
g++ \
automake \
build-essential \
cmake \
sqlite \
sqlite3 \
libsqlite3-dev \
libxml2-dev \
libjpeg-dev \
@@ -25,45 +23,33 @@ RUN apt-get update && apt-get install -y \
libfreetype6 \
libfreetype6-dev \
libzstd-dev \
libnetcdf-dev \
python3-pip \
pkg-config \
git \
wget \
curl \
unzip \
libcurl4 \
libcurl4-openssl-dev \
zlib1g-dev \
libfribidi-dev \
libharfbuzz-dev \
libcairo2-dev \
libfcgi-dev \
libgeos++-dev \
libpq-dev \
postgresql-server-dev-all \
libxml2-dev \
libgif-dev \
libprotobuf-dev \
protobuf-compiler \
libprotobuf-c-dev \
libprotobuf-c1 \
libprotobuf-dev \
protobuf-c-compiler \
&& rm -rf /var/lib/apt/lists/*
# Install libtiff
RUN mkdir -p /build_deps && cd /build_deps \
&& wget --no-check-certificate https://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz \
&& tar -zxf tiff-4.3.0.tar.gz \
&& cd tiff-4.3.0 \
&& wget --no-check-certificate http://www.libtiff.org/downloads/tiff-4.6.0t.tar.gz \
&& tar -zxf tiff-4.6.0t.tar.gz \
&& cd tiff-4.6.0t \
&& ./configure \
&& make \
&& make install
# Install Proj
RUN cd /build_deps \
&& git clone https://github.com/OSGeo/PROJ.git -b 8.2.1 && cd PROJ \
&& git clone https://github.com/OSGeo/PROJ.git -b 9.4.1 && cd PROJ \
&& mkdir -p build && cd build \
&& cmake .. \
&& make -j$(nproc) \
@@ -71,9 +57,9 @@ RUN cd /build_deps \
# Install libgeotiff
RUN cd /build_deps \
&& wget --no-check-certificate https://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.7.1.tar.gz \
&& tar -zxf libgeotiff-1.7.1.tar.gz \
&& cd libgeotiff-1.7.1 \
&& wget --no-check-certificate https://github.com/OSGeo/libgeotiff/releases/download/1.7.3/libgeotiff-1.7.3.tar.gz \
&& tar -zxf libgeotiff-1.7.3.tar.gz \
&& cd libgeotiff-1.7.3 \
&& mkdir -p build && cd build \
&& cmake .. \
&& make \
@@ -81,29 +67,34 @@ RUN cd /build_deps \
# Install GDAL
RUN cd /build_deps \
&& git clone --depth 1 --branch v3.5.0alpha1 https://github.com/OSGeo/gdal.git && cd gdal \
&& ./autogen.sh \
&& ./configure --with-crypto=no --with-curl=yes --with-netcdf=yes \
&& make -j$(nproc) \
&& make install
# Install Cython, Rasterio, and Fiona
RUN cd /build_deps && pip3 install cython rasterio fiona shapely pyproj
&& git clone --depth 1 --branch v3.9.1 https://github.com/OSGeo/gdal.git && cd gdal \
&& mkdir build && cd build \
&& cmake -DGDAL_USE_CURL=ON -DGDAL_USE_CRYPTOPP=OFF -DGDAL_USE_NETCDF=OFF .. \
&& cmake --build . \
&& cmake --build . --target install
# Install Mapserver
RUN cd /build_deps \
&& git clone https://github.com/mapserver/mapserver.git && cd mapserver \
&& git checkout rel-7-6-4 \
&& git checkout rel-8-2-0 \
&& mkdir -p build && cd build \
&& cmake .. -DWITH_GIF=OFF -DWITH_HARFBUZZ=OFF -DWITH_PROTOBUFC=OFF -DWITH_FRIBIDI=OFF -DWITH_POSTGIS=ON -DWITH_GEOS=OFF -DWITH_FCGI=ON -DWITH_CAIRO=OFF \
&& make -j$(nproc) \
&& make install
# Clean up
RUN cd /tmp && rm -r /build_deps
FROM ubuntu:24.04 AS proj-update
COPY --from=build /usr/local/share/proj /usr/local/share/proj
RUN apt-get update && apt-get install -y sqlite3
# Add our own custom EPSG codes (HACK)
# GOES-16 ABI Full Disk = EPSG:930916
# GOES-17 ABI Full Disk = EPSG:930917
COPY sql/ /work/sql/
RUN sqlite3 -bail /usr/local/share/proj/proj.db < /work/sql/goesr_crs.sql
FROM ubuntu:24.04 AS main
WORKDIR /work
@@ -118,23 +109,28 @@ ENV APACHE_PID_FILE /var/run/apache2/apache2.pid
ENV APACHE_SERVER_NAME localhost
#RUN groupadd -r www-data && useradd -r --create-home -g www-data www-data
# install httpd runtime dependencies
# install httpd and other runtime dependencies
# https://httpd.apache.org/docs/2.4/install.html#requirements
RUN apt-get update && apt-get -y install apache2 libapache2-mod-fcgid libapache2-mod-php php-common php-cli php-fpm php && \
RUN apt-get update && apt-get -y install apache2 libapache2-mod-fcgid curl unzip python3-pip && \
ls /etc/apache2/mods-available && \
ls /etc/apache2/mods-enabled && \
a2enmod actions proxy_fcgi setenvif cgi fcgid rewrite && \
a2enconf php7.4-fpm serve-cgi-bin && \
a2enconf serve-cgi-bin && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
RUN curl -LOk https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip \
&& curl -LOk https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip \
&& curl -LOk https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_lakes.zip \
&& curl -LOk https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_county_500k.zip \
&& curl -LOk https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_graticules_1.zip \
&& curl -LOk https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_graticules_5.zip \
&& curl -LOk https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_graticules_10.zip \
COPY --from=build /usr/local/bin /usr/local/bin
COPY --from=proj-update /usr/local/share/proj /usr/local/share/proj
COPY --from=build /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
COPY --from=build /usr/local/lib/libgdal* /usr/local/lib/libproj* /usr/local/lib/libtiff* /usr/local/lib/libgeotiff* /usr/local/lib/libmapserver* /usr/local/lib/
RUN curl -LO -e https://www.naturalearthdata.com https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip \
&& curl -LO -e https://www.naturalearthdata.com https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip \
&& curl -LO -e https://www.naturalearthdata.com https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_lakes.zip \
&& curl -LO -e https://www.naturalearthdata.com https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_county_500k.zip \
&& curl -LO -e https://www.naturalearthdata.com https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_graticules_1.zip \
&& curl -LO -e https://www.naturalearthdata.com https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_graticules_5.zip \
&& curl -LO -e https://www.naturalearthdata.com https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_graticules_10.zip \
&& mkdir -p /work/shapefiles \
&& unzip -d /work/shapefiles ne_10m_admin_0_countries.zip \
&& unzip -d /work/shapefiles ne_10m_admin_1_states_provinces_lines.zip \
@@ -168,19 +164,14 @@ RUN ln -s /usr/local/bin/mapserv /usr/lib/cgi-bin/mapserv && \
chown ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /usr/lib/cgi-bin/* && \
chown -h ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /usr/lib/cgi-bin/*
RUN pip3 install jinja2 psycopg2 && rm -r /root/.cache/pip
RUN python3 -m pip install --break-system-packages --root-user-action ignore jinja2 && rm -r /root/.cache/pip
COPY render.py run.sh abi_l1b_template.map /work/
COPY mapserver.conf /usr/local/etc/mapserver.conf
COPY mapfiles/ /work/mapfiles/
COPY html/ /var/www/html/
COPY default_settings.yaml /work/geosphere_settings.yaml
# Add our own custom EPSG codes (HACK)
# GOES-16 ABI Full Disk = EPSG:930916
# GOES-17 ABI Full Disk = EPSG:930917
COPY sql/ /work/sql/
RUN sqlite3 -bail /usr/local/share/proj/proj.db < /work/sql/goesr_crs.sql
# Check the config before we finish
RUN apache2ctl configtest
Loading