-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyqgis4-checker-ubuntu.dockerfile
More file actions
73 lines (61 loc) · 2.6 KB
/
pyqgis4-checker-ubuntu.dockerfile
File metadata and controls
73 lines (61 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# -- GLOBAL
# Arguments to customize build
ARG LINUX_DISTRO_NAME=ubuntu
ARG LINUX_DISTRO_VERSION=25.10
FROM ${LINUX_DISTRO_NAME}:${LINUX_DISTRO_VERSION}
LABEL org.opencontainers.image.title="QGIS with Qt6 (Ubuntu)" \
org.opencontainers.image.description="QGIS built with Qt6 from source code on Ubuntu base image." \
org.opencontainers.image.source="https://github.com/qgis/pyqgis4-checker" \
org.opencontainers.image.licenses="GPL-2.0-or-later"
# Write .pyc files only once. See: https://stackoverflow.com/a/60797635/2556577
ENV PYTHONDONTWRITEBYTECODE=1 \
# Make sure that stdout and stderr are not buffered. See: https://stackoverflow.com/a/59812588/2556577
PYTHONUNBUFFERED=1 \
# Remove assert statements and any code conditional on __debug__. See: https://docs.python.org/3/using/cmdline.html#cmdoption-O
PYTHONOPTIMIZE=2 \
# Set locale
LANG=C.UTF-8 \
LC_ALL=C.UTF-8
# ADD QGIS UBUNTU NIGHTLY REPOSITORY
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update && apt-get install --no-install-recommends -y \
# tools to add QGIS repository
ca-certificates \
gnupg \
lsb-release \
software-properties-common \
wget \
# add QGIS key and repository
&& mkdir -p /etc/apt/keyrings \
&& wget -qO /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/qgis-archive-keyring.gpg] https://ubuntu.qgis.org/ubuntu $(lsb_release -c -s) main" | tee /etc/apt/sources.list.d/qgis.list \
&& apt-get update
# Add PyQGIS migration script
ADD --chmod=755 https://github.com/qgis/QGIS/raw/refs/heads/master/scripts/pyqt5_to_pyqt6/pyqt5_to_pyqt6.py /usr/local/bin/
# INSTALL QGIS QT6 PACKAGE AND DEPENDENCIES
RUN apt-get install -y \
qgis \
qgis-plugin-grass \
# for Python code editor and console in QGIS
python3-pyqt6.qsci \
python3-pyqt6.qtquick \
# python tooling
python3-pip \
python3-wheel \
# migration script dependencies
&& python3 -m pip install --no-cache-dir --upgrade astpretty tokenize-rt --break-system-packages \
# cleanup
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Reference QGIS Python packages into the Python environment
ENV PYTHONPATH=/usr/share/qgis/python:/usr/lib/python3/dist-packages
# Create non-root user
RUN useradd -ms /bin/bash quser \
&& groupadd -f sudo \
&& usermod -aG sudo quser \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER quser
WORKDIR /home/quser
# Default command
CMD ["/bin/bash"]