Skip to content

Commit

Permalink
conteiner to run qgis with X2Go
Browse files Browse the repository at this point in the history
  • Loading branch information
85humberto committed Apr 6, 2020
1 parent b0bf0e3 commit f9acdb9
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
49 changes: 49 additions & 0 deletions qgis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Baseado em:
# - https://docs.docker.com/engine/examples/running_ssh_service/
# - https://github.com/theodotos/debian-ssh-docker

FROM debian:stable

ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="[email protected]" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="CTIC-SJE-IFSC Kubernetes: qgis" \
org.label-schema.description="Nuvem privada do Câmpus São José do IFSC" \
org.label-schema.license="MIT" \
org.label-schema.url="https://projetos.sj.ifsc.edu.br" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/ctic-sje-ifsc/servicos_kubernetes" \
org.label-schema.vendor="CTIC" \
org.label-schema.version="3.10.4+15buster" \
org.label-schema.schema-version="1.0"

ENV DEBIAN_FRONTEND noninteractive
COPY ./docker-entrypoint.sh /
RUN chmod 0755 /docker-entrypoint.sh && \
apt update && \
apt -y upgrade && \
echo 'deb http://packages.x2go.org/debian stable main' >> /etc/apt/sources.list.d/x2go.list && \
echo 'deb-src http://packages.x2go.org/debian stable main' >> /etc/apt/sources.list.d/x2go.list && \
apt -y install curl git mount davfs2 fuse sudo gnupg apt-utils

RUN apt-key adv --no-tty --keyserver keyserver.cais.rnp.br --receive-keys 0xe1f958385bfe2b6e && \
apt update && \
apt -y install openssh-server x2go-keyring x2goserver x2goserver-xsession libglu1-mesa libasound2 libdbus-glib-1-2

RUN apt install wget && \
wget -qO - https://qgis.org/downloads/qgis-2019.gpg.key | sudo apt-key add - && \
echo 'deb https://qgis.org/debian-ltr buster main' > /etc/apt/sources.list.d/qgis.list && \
apt update && \
apt -y install qgis python-qgis qgis-plugin-grass
RUN apt clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* && \
mkdir -p /var/run/sshd && \
install -d -g root -m 0700 -o root /root/.ssh

RUN useradd -m -d /home/aluno -s /bin/bash aluno && \
echo "aluno:aluno" | chpasswd

EXPOSE 22
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/sbin/sshd", "-D"]
6 changes: 6 additions & 0 deletions qgis/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
all: create

create:
docker build -t cticsjeifsc/qgis .
docker login
docker push cticsjeifsc/qgis
10 changes: 10 additions & 0 deletions qgis/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e

# SSH login fix. Otherwise user is kicked off after login
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

echo "X11UseLocalhost no" >> /etc/ssh/sshd_config

exec "$@"
5 changes: 5 additions & 0 deletions qgis/hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

docker build --build-arg VCS_REF=$(git rev-parse --short HEAD) \
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
-t $IMAGE_NAME .

0 comments on commit f9acdb9

Please sign in to comment.