Permalink
Browse files

Update dockerfiles, add oracle and mapcache options

  • Loading branch information...
msmitherdc committed Feb 8, 2017
1 parent df06a0a commit ae1e2299abc115e8679509cdf2e4c070c16dea06
Showing with 469 additions and 77 deletions.
  1. +97 −77 scripts/docker/Dockerfile
  2. +180 −0 scripts/docker/Dockerfile_mapcache
  3. +192 −0 scripts/docker/Dockerfile_oracle_mapcache
@@ -1,13 +1,4 @@
##
# mapserver/mapserver
#
# This creates an Ubuntu derived base image that installs the MAPSERVER_VERSION of MapServer and the GDAL_VERSION of GDAL
# Git checkout compiled with needed drivers.
#
# Ubuntu
FROM ubuntu:vivid
FROM ubuntu:xenial
MAINTAINER Michael Smith <Michael.smith.erdc@gmail.com>
#Setup user
@@ -16,92 +7,93 @@ ARG GID
RUN addgroup --gid $GID msgroup
RUN adduser --no-create-home --disabled-login msuser --gecos "" --uid $UID --gid $GID
ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
ENV LIBKML_DOWNLOAD=install-libkml-r864-64bit.tar.gz
ENV FILEGDBAPI_DOWNLOAD=FileGDB_API_1_2-64.tar.gz
ENV MRSID_DIR=MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44
ENV MRSID_DOWNLOAD=MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44.tar.gz
# Setup build env
RUN mkdir /build
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 16126D3A3E5C1192 \
&& apt-get update && apt-get install -y --fix-missing --no-install-recommends software-properties-common \
&& add-apt-repository ppa:ubuntugis/ubuntugis-unstable -y \
&& apt-get update && apt-get install -y --fix-missing --no-install-recommends build-essential ca-certificates curl wget git make cmake python-numpy python-dev \
&& apt-get update && apt-get install -y --fix-missing --no-install-recommends gcc-4.7 g++-4.7 build-essential ca-certificates curl wget git libaio1 make cmake python-dev \
python-software-properties software-properties-common libc6-dev openssh-client libpng12-dev libjpeg-dev libgif-dev liblzma-dev libgeos-dev \
libproj-dev libxml2-dev libexpat-dev libxerces-c-dev libnetcdf-dev netcdf-bin libpoppler-dev libspatialite-dev swig \
libhdf5-serial-dev libpodofo-dev poppler-utils libfreexl-dev libwebp-dev libepsilon-dev libpcre3-dev gfortran \
libpq-dev libhdf5-serial-dev libhdf5-dev libjsoncpp-dev clang libhdf4-alt-dev libsqlite3-dev \
libltdl-dev libcurl4-openssl-dev ninja python-pip libpng-dev libjasper-dev libdap-dev ninja libfreetype6-dev \
unzip libcairo2-dev libpq-dev libharfbuzz-dev libfribidi-dev flex bison libfcgi-dev libxml2 bzip2 apache2 apache2-threaded-dev apache2-mpm-worker \
libhdf5-serial-dev libpodofo-dev poppler-utils libfreexl-dev libwebp-dev libepsilon-dev libpcre3-dev gfortran libarpack2-dev \
libpq-dev libflann-dev libhdf5-serial-dev libhdf5-dev libjsoncpp-dev clang-3.8 libhdf4-alt-dev libsqlite3-dev \
libltdl-dev libcurl4-openssl-dev ninja cython python-pip libpng-dev \
libboost-filesystem1.58-dev libboost-iostreams1.58-dev libboost-program-options1.58-dev libboost-system1.58-dev libboost-thread1.58-dev libogdi3.2-dev time \
&& apt-get remove --purge -y $BUILD_PACKAGES && rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20 && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20
#RUN CXX=clang++ && CC=clang
#RUN dpkg --add-architecture i386 && apt-get update && apt-get install -y openjdk-8-jre:i386
# Getting libKML
ENV LIBKML_DOWNLOAD=install-libkml-r864-64bit.tar.gz
RUN wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/${LIBKML_DOWNLOAD} -O /build/${LIBKML_DOWNLOAD} \
&& tar -C /build -xzf /build/${LIBKML_DOWNLOAD} \
&& cp -r /build/install-libkml/include/* /usr/local/include \
&& cp -r /build/install-libkml/lib/* /usr/local/lib \
&& rm -Rf /build/install-libkml
RUN wget --no-verbose http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/${LIBKML_DOWNLOAD} -O /build/${LIBKML_DOWNLOAD} && \
tar -C /build -xzf /build/${LIBKML_DOWNLOAD} && \
cp -r /build/install-libkml/include/* /usr/local/include && \
cp -r /build/install-libkml/lib/* /usr/local/lib \
&& rm -Rf /build/install-libkml
RUN wget --no-verbose http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/${MRSID_DOWNLOAD} -O /build/${MRSID_DOWNLOAD} && \
tar -C /build -xzf /build/${MRSID_DOWNLOAD} && \
cp -r /build/${MRSID_DIR}/Raster_DSDK/include/* /usr/local/include && \
cp -r /build/${MRSID_DIR}/Raster_DSDK/lib/* /usr/local/lib \
&& rm -Rf /build/${MRSID_DIR}
RUN wget --no-verbose http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/${FILEGDBAPI_DOWNLOAD} -O /build/${FILEGDBAPI_DOWNLOAD} && \
tar -C /build -xzf /build/${FILEGDBAPI_DOWNLOAD} && \
cp -r /build/FileGDB_API/include/* /usr/local/include && \
cp -r /build/FileGDB_API/lib/* /usr/local/lib \
&& rm -Rf /build/FileGDB_API
ARG GDAL_VERSION
RUN cd /build \
&& git clone https://github.com/OSGeo/gdal.git \
&& cd /build/gdal \
&& git checkout ${GDAL_VERSION} \
&& cd /build/gdal/gdal \
&& ./configure \
RUN cd /build && \
git clone https://github.com/OSGeo/gdal.git && \
cd /build/gdal && \
git checkout ${GDAL_VERSION} && \
cd /build/gdal/gdal && \
./configure --prefix=/usr \
--with-png=internal \
--with-jpeg=internal \
--with-libz=internal \
--with-libtiff=internal \
--with-geotiff=internal \
--with-gif=internal \
--with-libjson-c=internal \
--with-python \
--with-poppler \
--with-podofo \
--with-spatialite \
--with-liblzma \
--with-ogdi \
--with-webp \
--with-pg \
--with-hdf5 \
--with-hdf4 \
--with-webp \
--with-jasper \
--with-netcdf \
--with-ogdi \
--with-dods-root=/usr \
--with-openjpeg=yes \
--with-freexl=yes \
--with-libkml=yes \
--with-armadillo=yes \
--with-liblzma=yes \
--with-epsilon=/usr \
&& make \
&& make install \
&& ldconfig \
&& rm -Rf /build/gdal
RUN mkdir /vdatum \
&& cd /vdatum \
&& wget http://download.osgeo.org/proj/vdatum/usa_geoid2012.zip && unzip -j -u usa_geoid2012.zip -d /usr/share/proj \
&& wget http://download.osgeo.org/proj/vdatum/usa_geoid2009.zip && unzip -j -u usa_geoid2009.zip -d /usr/share/proj \
&& wget http://download.osgeo.org/proj/vdatum/usa_geoid2003.zip && unzip -j -u usa_geoid2003.zip -d /usr/share/proj \
&& wget http://download.osgeo.org/proj/vdatum/usa_geoid1999.zip && unzip -j -u usa_geoid1999.zip -d /usr/share/proj \
&& wget http://download.osgeo.org/proj/vdatum/vertcon/vertconc.gtx && mv vertconc.gtx /usr/share/proj \
&& wget http://download.osgeo.org/proj/vdatum/vertcon/vertcone.gtx && mv vertcone.gtx /usr/share/proj \
&& wget http://download.osgeo.org/proj/vdatum/vertcon/vertconw.gtx && mv vertconw.gtx /usr/share/proj \
&& wget http://download.osgeo.org/proj/vdatum/egm96_15/egm96_15.gtx && mv egm96_15.gtx /usr/share/proj \
&& wget http://download.osgeo.org/proj/vdatum/egm08_25/egm08_25.gtx && mv egm08_25.gtx /usr/share/proj \
&& rm -rf /vdatum
RUN apt-get install apache2
--with-mrsid=/usr/local \
--with-fgdb=/usr/local \
--with-libkml \
--with-hdf5 && \
make && \
make install && \
ldconfig && \
rm -Rf /build/gdal
RUN apt-get update && apt-get install -y --fix-missing --no-install-recommends build-essential ca-certificates curl wget \
subversion git libaio1 make cmake python-numpy python-dev python-software-properties software-properties-common libv8-dev libc6-dev libfreetype6-dev \
libcairo2-dev libpq-dev libharfbuzz-dev libfribidi-dev flex bison libfcgi-dev libxml2 libxml2-dev bzip2 apache2 apache2-utils apache2-dev \
libaprutil1-dev libapr1-dev libpng12-dev libjpeg-dev libcurl4-gnutls-dev libpcre3-dev libpixman-1-dev libgeos-dev libsqlite3-dev libdb-dev libtiff-dev sudo \
&& rm -rf /var/lib/apt/lists/partial/* /tmp/* /var/tmp/*
RUN echo "msuser ALL=NOPASSWD: ALL" >> /etc/sudoers
ARG MAPSERVER_VERSION
RUN cd /build \
&& git clone https://github.com/mapserver/mapserver.git mapserver \
&& cd /build/mapserver \
&& git checkout ${MAPSERVER_VERSION} \
&& mkdir /build/mapserver/build
RUN cd /build/mapserver/build \
&& cmake \
RUN cd /build && \
git clone https://github.com/mapserver/mapserver.git mapserver && \
cd /build/mapserver && \
git checkout ${MAPSERVER_VERSION} \
&& mkdir /build/mapserver/build \
&& cd /build/mapserver/build \
&& cmake \
-DCMAKE_BUILD_TYPE=Release \
-DHARFBUZZ_INCLUDE_DIR=/usr/include/harfbuzz \
-DWITH_CLIENT_WFS=ON \
@@ -123,28 +115,56 @@ RUN cd /build/mapserver/build \
-DWITH_FCGI=ON \
-DWITH_FRIBIDI=ON \
-DWITH_CAIRO=ON \
-DWITH_POSTGRES=ON \
-DWITH_HARFBUZZ=ON \
-DWITH_POSTGIS=on \
-DWITH_V8=OFF \
.. \
&& make \
&& make install \
&& ldconfig \
&& rm -Rf /build/mapserver
# Externally accessible data is by default put in /u02
WORKDIR /data
# Install Mapcache itself
ARG MAPCACHE_VERSION
RUN cd /build \
&& mkdir -p /msconfig/mapcache \
&& git clone https://github.com/mapserver/mapcache/ \
&& cd /build/mapcache \
&& git checkout ${MAPCACHE_VERSION} \
&& mkdir /build/mapcache/build \
&& cd /build/mapcache/build \
&& cmake ../ \
-DWITH_FCGI=0 -DWITH_APACHE=1 -DWITH_PCRE=1 \
-DWITH_TIFF=1 -DWITH_BERKELEY_DB=1 -DWITH_MEMCACHE=1 \
-DCMAKE_PREFIX_PATH="/etc/apache2" && \
make && \
make install
#RUN mkdir /vdatum \
# && cd /vdatum \
# && wget http://download.osgeo.org/proj/vdatum/usa_geoid2012.zip && unzip -j -u usa_geoid2012.zip -d /usr/share/proj \
# && wget http://download.osgeo.org/proj/vdatum/usa_geoid2009.zip && unzip -j -u usa_geoid2009.zip -d /usr/share/proj \
# && wget http://download.osgeo.org/proj/vdatum/usa_geoid2003.zip && unzip -j -u usa_geoid2003.zip -d /usr/share/proj \
# && wget http://download.osgeo.org/proj/vdatum/usa_geoid1999.zip && unzip -j -u usa_geoid1999.zip -d /usr/share/proj \
# && wget http://download.osgeo.org/proj/vdatum/vertcon/vertconc.gtx && mv vertconc.gtx /usr/share/proj \
# && wget http://download.osgeo.org/proj/vdatum/vertcon/vertcone.gtx && mv vertcone.gtx /usr/share/proj \
# && wget http://download.osgeo.org/proj/vdatum/vertcon/vertconw.gtx && mv vertconw.gtx /usr/share/proj \
# && wget http://download.osgeo.org/proj/vdatum/egm96_15/egm96_15.gtx && mv egm96_15.gtx /usr/share/proj \
# && wget http://download.osgeo.org/proj/vdatum/egm08_25/egm08_25.gtx && mv egm08_25.gtx /usr/share/proj \
# && rm -rf /vdatum
# Force buit libraries dependencies
RUN ldconfig
# Enable these Apache modules
RUN a2enmod actions cgi alias
RUN a2enmod actions cgi alias headers
RUN chmod o+x /usr/local/bin/mapserv
RUN ln -s /usr/local/bin/mapserv /usr/lib/cgi-bin/mapserv
RUN chmod 755 /usr/lib/cgi-bin
EXPOSE 80
ENV HOST_IP `ifconfig | grep inet | grep Mask:255.255.255.0 | cut -d ' ' -f 12 | cut -d ':' -f 2`
CMD apache2ctl -D FOREGROUND
CMD sudo service apache2 start && bash
USER msuser
Oops, something went wrong.

0 comments on commit ae1e229

Please sign in to comment.