|
| 1 | +FROM postgres:13 |
| 2 | + |
| 3 | +LABEL maintainer="PostGIS Project - https://postgis.net" |
| 4 | + |
| 5 | +ENV SFCGAL_VERSION master |
| 6 | +ENV SFCGAL_GIT_HASH 929605c8ea85f2c01efa116e1ed0eb01d285ea09 |
| 7 | +ENV PROJ_VERSION master |
| 8 | +ENV PROJ_GIT_HASH 5d502d356e16ef81f481eb82dcdeba0ea3ab1f9e |
| 9 | +ENV GDAL_VERSION master |
| 10 | +ENV GDAL_GIT_HASH 5adc1949498b536cc787920c99db965c20c03b69 |
| 11 | +ENV GEOS_VERSION master |
| 12 | +ENV GEOS_GIT_HASH 099e74b3127348e1f8544ab279b609e2fdc6cc74 |
| 13 | +ENV POSTGIS_VERSION master |
| 14 | +ENV POSTGIS_GIT_HASH 16121bf7939891022824152c0ca095aeebbad2ed |
| 15 | + |
| 16 | +RUN set -ex \ |
| 17 | + && apt-get update \ |
| 18 | + && apt-get install -y --no-install-recommends \ |
| 19 | + curl \ |
| 20 | + libboost-atomic1.67.0 \ |
| 21 | + libboost-chrono1.67.0 \ |
| 22 | + libboost-date-time1.67.0 \ |
| 23 | + libboost-filesystem1.67.0 \ |
| 24 | + libboost-program-options1.67.0 \ |
| 25 | + libboost-serialization1.67.0 \ |
| 26 | + libboost-system1.67.0 \ |
| 27 | + libboost-test1.67.0 \ |
| 28 | + libboost-thread1.67.0 \ |
| 29 | + libboost-timer1.67.0 \ |
| 30 | + libcgal13 \ |
| 31 | + libcurl3-gnutls \ |
| 32 | + libexpat1 \ |
| 33 | + libgmp10 \ |
| 34 | + libgmpxx4ldbl \ |
| 35 | + libjson-c3 \ |
| 36 | + libmpfr6 \ |
| 37 | + libprotobuf-c1 \ |
| 38 | + libtiff5 \ |
| 39 | + libxml2 \ |
| 40 | + sqlite3 \ |
| 41 | + && apt-get install -y --no-install-recommends \ |
| 42 | + autoconf \ |
| 43 | + automake \ |
| 44 | + autotools-dev \ |
| 45 | + bison \ |
| 46 | + build-essential \ |
| 47 | + ca-certificates \ |
| 48 | + cmake \ |
| 49 | + git \ |
| 50 | + g++ \ |
| 51 | + libboost-all-dev \ |
| 52 | + libcgal-dev \ |
| 53 | + libcurl4-gnutls-dev \ |
| 54 | + libgmp-dev \ |
| 55 | + libjson-c-dev \ |
| 56 | + libmpfr-dev \ |
| 57 | + libprotobuf-c-dev \ |
| 58 | + libsqlite3-dev \ |
| 59 | + libtiff-dev \ |
| 60 | + libtool \ |
| 61 | + libxml2-dev \ |
| 62 | + make \ |
| 63 | + pkg-config \ |
| 64 | + postgresql-server-dev-$PG_MAJOR \ |
| 65 | + protobuf-c-compiler \ |
| 66 | + xsltproc \ |
| 67 | + # sfcgal |
| 68 | + && mkdir -p /usr/src/sfcgal \ |
| 69 | + && cd /usr/src/sfcgal \ |
| 70 | + && git init \ |
| 71 | + && git remote add origin https://github.com/Oslandia/SFCGAL.git \ |
| 72 | + && git fetch --depth 1 origin :${SFCGAL_GIT_HASH} \ |
| 73 | + && git reset --hard FETCH_HEAD \ |
| 74 | + && mkdir cmake-build \ |
| 75 | + && cd cmake-build \ |
| 76 | + && cmake .. \ |
| 77 | + && make -j$(nproc) \ |
| 78 | + && make install \ |
| 79 | + && cd / \ |
| 80 | + && rm -fr /usr/src/sfcgal \ |
| 81 | + # proj4 |
| 82 | + && mkdir -p /usr/src/proj \ |
| 83 | + && cd /usr/src/proj \ |
| 84 | + && git init \ |
| 85 | + && git remote add origin https://github.com/OSGeo/PROJ.git \ |
| 86 | + && git fetch --depth 1 origin :${PROJ_GIT_HASH} \ |
| 87 | + && git reset --hard FETCH_HEAD \ |
| 88 | + && ./autogen.sh \ |
| 89 | + && ./configure --disable-static \ |
| 90 | + && make -j$(nproc) \ |
| 91 | + && make install \ |
| 92 | + && cd / \ |
| 93 | + && rm -fr /usr/src/proj \ |
| 94 | + # geos |
| 95 | + && mkdir -p /usr/src/geos \ |
| 96 | + && cd /usr/src/geos \ |
| 97 | + && git init \ |
| 98 | + && git remote add origin https://github.com/libgeos/geos.git \ |
| 99 | + && git fetch --depth 1 origin :${GEOS_GIT_HASH} \ |
| 100 | + && git reset --hard FETCH_HEAD \ |
| 101 | + && ./autogen.sh \ |
| 102 | + && ./configure --disable-static \ |
| 103 | + && make -j$(nproc) \ |
| 104 | + && make install \ |
| 105 | + && cd / \ |
| 106 | + && rm -fr /usr/src/geos \ |
| 107 | + # gdal |
| 108 | + && mkdir -p /usr/src/gdal \ |
| 109 | + && cd /usr/src/gdal \ |
| 110 | + && git init \ |
| 111 | + && git remote add origin https://github.com/OSGeo/gdal.git \ |
| 112 | + && git fetch --depth 1 origin :${GDAL_GIT_HASH} \ |
| 113 | + && git reset --hard FETCH_HEAD \ |
| 114 | + && cd gdal \ |
| 115 | + && ./autogen.sh \ |
| 116 | + && ./configure --disable-static \ |
| 117 | + && make -j$(nproc) \ |
| 118 | + && make install \ |
| 119 | + && cd / \ |
| 120 | + && rm -fr /usr/src/gdal \ |
| 121 | + # postgis |
| 122 | + && mkdir -p /usr/src/postgis \ |
| 123 | + && cd /usr/src/postgis \ |
| 124 | + && git init \ |
| 125 | + && git remote add origin https://git.osgeo.org/gitea/postgis/postgis.git \ |
| 126 | + && git fetch --depth 1 origin :${POSTGIS_GIT_HASH} \ |
| 127 | + && git reset --hard FETCH_HEAD \ |
| 128 | + && ./autogen.sh \ |
| 129 | +# configure options taken from: |
| 130 | +# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie |
| 131 | + && ./configure \ |
| 132 | +# --with-gui \ |
| 133 | + && make -j$(nproc) \ |
| 134 | + && make install \ |
| 135 | + && cd / \ |
| 136 | + && rm -rf /usr/src/postgis \ |
| 137 | + && apt-get purge -y --autoremove \ |
| 138 | + autoconf \ |
| 139 | + automake \ |
| 140 | + autotools-dev \ |
| 141 | + bison \ |
| 142 | + build-essential \ |
| 143 | + ca-certificates \ |
| 144 | + cmake \ |
| 145 | + git \ |
| 146 | + g++ \ |
| 147 | + libboost-all-dev \ |
| 148 | + libcgal-dev \ |
| 149 | + libcurl4-gnutls-dev \ |
| 150 | + libgmp-dev \ |
| 151 | + libjson-c-dev \ |
| 152 | + libmpfr-dev \ |
| 153 | + libprotobuf-c-dev \ |
| 154 | + libsqlite3-dev \ |
| 155 | + libtiff-dev \ |
| 156 | + libtool \ |
| 157 | + libxml2-dev \ |
| 158 | + make \ |
| 159 | + pkg-config \ |
| 160 | + postgresql-server-dev-$PG_MAJOR \ |
| 161 | + protobuf-c-compiler \ |
| 162 | + xsltproc \ |
| 163 | + && rm -rf /var/lib/apt/lists/* \ |
| 164 | + # Minimal command line test. |
| 165 | + && cs2cs \ |
| 166 | + && gdalinfo --version \ |
| 167 | + && geos-config --version \ |
| 168 | + && ogr2ogr --version \ |
| 169 | + && proj \ |
| 170 | + && sfcgal-config --version |
| 171 | + |
| 172 | +RUN mkdir -p /docker-entrypoint-initdb.d |
| 173 | +COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh |
| 174 | +COPY ./update-postgis.sh /usr/local/bin |
| 175 | + |
0 commit comments