2018-02-27 09:16:02 -09:00
|
|
|
|
|
|
|
# see https://docs.docker.com/docker-cloud/builds/advanced/
|
|
|
|
# using ARG in FROM requires min v17.05.0-ce
|
|
|
|
ARG DOCKER_TAG=latest
|
|
|
|
|
2019-10-17 09:50:05 +02:00
|
|
|
FROM qgis/qgis3-build-deps:${DOCKER_TAG} AS BUILDER
|
2018-02-27 09:16:02 -09:00
|
|
|
MAINTAINER Denis Rouzaud <denis@opengis.ch>
|
|
|
|
|
2018-11-15 08:31:58 +01:00
|
|
|
LABEL Description="Docker container with QGIS" Vendor="QGIS.org" Version="1.1"
|
2018-11-13 12:50:53 +01:00
|
|
|
|
2019-10-17 09:50:05 +02:00
|
|
|
# build timeout in seconds, so no timeout by default
|
|
|
|
ARG BUILD_TIMEOUT=360000
|
|
|
|
|
2019-06-18 16:58:11 +02:00
|
|
|
ARG CC=/usr/lib/ccache/clang
|
|
|
|
ARG CXX=/usr/lib/ccache/clang++
|
2018-02-27 09:16:02 -09:00
|
|
|
ENV LANG=C.UTF-8
|
|
|
|
|
2019-10-17 09:50:05 +02:00
|
|
|
COPY . /QGIS
|
2018-02-27 09:16:02 -09:00
|
|
|
|
2019-03-05 12:48:50 +01:00
|
|
|
# If this directory is changed, also adapt script.sh which copies the directory
|
2019-10-17 09:50:05 +02:00
|
|
|
# if ccache directory is not provided with the source
|
|
|
|
RUN mkdir -p /QGIS/.ccache_image_build
|
|
|
|
ENV CCACHE_DIR=/QGIS/.ccache_image_build
|
2018-02-27 09:16:02 -09:00
|
|
|
RUN ccache -M 1G
|
2018-11-18 10:36:33 +01:00
|
|
|
RUN ccache -s
|
2018-02-27 09:16:02 -09:00
|
|
|
|
2019-10-17 09:50:05 +02:00
|
|
|
RUN echo "ccache_dir: "$(du -h --max-depth=0 ${CCACHE_DIR})
|
|
|
|
|
|
|
|
WORKDIR /QGIS/build
|
2018-02-27 09:16:02 -09:00
|
|
|
|
|
|
|
RUN cmake \
|
|
|
|
-GNinja \
|
2018-11-18 10:38:56 +01:00
|
|
|
-DUSE_CCACHE=OFF \
|
2018-02-27 09:16:02 -09:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2018-11-13 12:50:53 +01:00
|
|
|
-DWITH_DESKTOP=ON \
|
2018-02-27 09:16:02 -09:00
|
|
|
-DWITH_SERVER=ON \
|
|
|
|
-DWITH_3D=ON \
|
|
|
|
-DWITH_BINDINGS=ON \
|
|
|
|
-DBINDINGS_GLOBAL_INSTALL=ON \
|
|
|
|
-DWITH_STAGED_PLUGINS=ON \
|
|
|
|
-DWITH_GRASS=ON \
|
|
|
|
-DSUPPRESS_QT_WARNINGS=ON \
|
|
|
|
-DDISABLE_DEPRECATED=ON \
|
|
|
|
-DENABLE_TESTS=OFF \
|
|
|
|
-DWITH_QSPATIALITE=ON \
|
|
|
|
-DWITH_APIDOC=OFF \
|
|
|
|
-DWITH_ASTYLE=OFF \
|
2018-11-17 14:34:37 +01:00
|
|
|
-DQT5_3DEXTRA_LIBRARY="/usr/lib/x86_64-linux-gnu/libQt53DExtras.so" \
|
2019-10-17 09:50:05 +02:00
|
|
|
-DQT5_3DEXTRA_INCLUDE_DIR="/QGIS/external/qt3dextra-headers" \
|
|
|
|
-DCMAKE_PREFIX_PATH="/QGIS/external/qt3dextra-headers/cmake" \
|
2018-02-27 09:16:02 -09:00
|
|
|
.. \
|
2019-10-17 09:50:05 +02:00
|
|
|
&& echo "Timeout: ${BUILD_TIMEOUT}s" \
|
|
|
|
&& SUCCESS=OK \
|
|
|
|
&& timeout ${BUILD_TIMEOUT}s ninja install || SUCCESS=TIMEOUT \
|
|
|
|
&& echo "$SUCCESS" > /QGIS/build_exit_value
|
2018-02-27 09:16:02 -09:00
|
|
|
|
2018-11-13 12:50:53 +01:00
|
|
|
################################################################################
|
2019-10-17 09:50:05 +02:00
|
|
|
ARG DELETE_CACHE=FALSE
|
|
|
|
RUN if [[ ${DELETE_CACHE} == TRUE ]]; then rm /QGIS; fi
|
|
|
|
|
2018-11-13 12:50:53 +01:00
|
|
|
# Python testing environment setup
|
|
|
|
|
|
|
|
# Add QGIS test runner
|
2019-03-22 13:03:55 -05:00
|
|
|
COPY .docker/qgis_resources/test_runner/qgis_* /usr/bin/
|
2018-11-13 12:50:53 +01:00
|
|
|
|
|
|
|
# Make all scripts executable
|
|
|
|
RUN chmod +x /usr/bin/qgis_*
|
|
|
|
|
|
|
|
# Add supervisor service configuration script
|
2019-03-27 09:12:53 -05:00
|
|
|
COPY .docker/qgis_resources/supervisor/ /etc/supervisor
|
2018-11-13 12:50:53 +01:00
|
|
|
|
|
|
|
# Python paths are for
|
|
|
|
# - kartoza images (compiled)
|
|
|
|
# - deb installed
|
|
|
|
# - built from git
|
|
|
|
# needed to find PyQt wrapper provided by QGIS
|
2019-01-17 14:42:04 +01:00
|
|
|
ENV PYTHONPATH=/usr/share/qgis/python/:/usr/share/qgis/python/plugins:/usr/lib/python3/dist-packages/qgis:/usr/share/qgis/python/qgis
|
2018-11-13 12:50:53 +01:00
|
|
|
|
|
|
|
|
2018-02-27 09:16:02 -09:00
|
|
|
WORKDIR /
|
2018-11-13 12:50:53 +01:00
|
|
|
|
|
|
|
# Run supervisor
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|