toastie89 1 year ago
parent
commit
400cbcbbff
2 changed files with 135 additions and 0 deletions
  1. 101 0
      Dockerfile-daniel
  2. 34 0
      docker-compose.yml

+ 101 - 0
Dockerfile-daniel

@@ -0,0 +1,101 @@
+FROM ubuntu:20.04 as builder
+MAINTAINER Daniel Guerra
+
+# Install packages
+
+ENV DEBIAN_FRONTEND noninteractive
+RUN sed -i "s/# deb-src/deb-src/g" /etc/apt/sources.list
+RUN apt-get -y update
+RUN apt-get -yy upgrade
+ENV BUILD_DEPS="git autoconf pkg-config libssl-dev libpam0g-dev \
+    libx11-dev libxfixes-dev libxrandr-dev nasm xsltproc flex \
+    bison libxml2-dev dpkg-dev libcap-dev"
+RUN apt-get -yy install  sudo apt-utils software-properties-common $BUILD_DEPS
+
+
+# Build xrdp
+
+WORKDIR /tmp
+RUN apt-get source pulseaudio
+RUN apt-get build-dep -yy pulseaudio
+WORKDIR /tmp/pulseaudio-13.99.1
+RUN dpkg-buildpackage -rfakeroot -uc -b
+WORKDIR /tmp
+RUN git clone --branch devel --recursive https://github.com/neutrinolabs/xrdp.git
+WORKDIR /tmp/xrdp
+RUN ./bootstrap
+RUN ./configure
+RUN make
+RUN make install
+WORKDIR /tmp
+RUN  apt -yy install libpulse-dev
+RUN git clone --recursive https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
+WORKDIR /tmp/pulseaudio-module-xrdp
+RUN ./bootstrap && ./configure PULSE_DIR=/tmp/pulseaudio-13.99.1
+RUN make
+RUN mkdir -p /tmp/so
+RUN cp src/.libs/*.so /tmp/so
+
+FROM ubuntu:20.04
+ARG ADDITIONAL_PACKAGES=""
+ENV ADDITIONAL_PACKAGES=${ADDITIONAL_PACKAGES}
+ENV DEBIAN_FRONTEND noninteractive
+RUN apt update && apt install -y software-properties-common apt-utils
+RUN add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner" && apt update
+RUN apt -y full-upgrade && apt-get install -y \
+  adobe-flashplugin \
+  browser-plugin-freshplayer-pepperflash \
+  ca-certificates \
+  crudini \
+  firefox \
+  less \
+  locales \
+  openssh-server \
+  pulseaudio \
+  sudo \
+  supervisor \
+  uuid-runtime \
+  vim \
+  vlc \
+  wget \
+  xauth \
+  xautolock \
+  xfce4 \
+  xfce4-clipman-plugin \
+  xfce4-cpugraph-plugin \
+  xfce4-netload-plugin \
+  xfce4-screenshooter \
+  xfce4-taskmanager \
+  xfce4-terminal \
+  xfce4-xkb-plugin \
+  xorgxrdp \
+  xprintidle \
+  xrdp \
+  $ADDITIONAL_PACKAGES && \
+  apt remove -y light-locker xscreensaver && \
+  apt autoremove -y && \
+  rm -rf /var/cache/apt /var/lib/apt/lists && \
+  mkdir -p /var/lib/xrdp-pulseaudio-installer
+COPY --from=builder /tmp/so/module-xrdp-source.so /var/lib/xrdp-pulseaudio-installer
+COPY --from=builder /tmp/so/module-xrdp-sink.so /var/lib/xrdp-pulseaudio-installer
+ADD bin /usr/bin
+ADD etc /etc
+ADD autostart /etc/xdg/autostart
+
+# Configure
+RUN mkdir /var/run/dbus && \
+  cp /etc/X11/xrdp/xorg.conf /etc/X11 && \
+  sed -i "s/console/anybody/g" /etc/X11/Xwrapper.config && \
+  sed -i "s/xrdp\/xorg/xorg/g" /etc/xrdp/sesman.ini && \
+  locale-gen en_US.UTF-8 && \
+  echo "pulseaudio -D --enable-memfd=True" > /etc/skel/.Xsession && \
+  echo "xfce4-session" >> /etc/skel/.Xsession && \
+  cp -r /etc/ssh /ssh_orig && \
+  rm -rf /etc/ssh/* && \
+  rm -rf /etc/xrdp/rsakeys.ini /etc/xrdp/*.pem
+
+# Docker config
+VOLUME ["/etc/ssh","/home"]
+EXPOSE 3389 22 9001
+ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
+CMD ["supervisord"]

+ 34 - 0
docker-compose.yml

@@ -0,0 +1,34 @@
+version: '3.8'
+services:
+  terminalserver:
+    image: danielguerra/ubuntu-xrdp
+    shm_size: '1G'
+
+    build:
+      context: ./build
+      args:
+        ADDITIONAL_PACKAGES: less libreoffice inkscape ttf-bitstream-vera geany geany-plugin-treebrowser geany-plugin-spellcheck geany-plugin-shiftcolumn geany-plugin-vc geany-plugin-git-changebar iputils-ping virt-manager ssh-askpass okular gimp gvfs-backends dnsutils git digikam pdfshuffler xfce4-whiskermenu-plugin galculator gigolo thunar-archive-plugin software-properties-common gajim gajim-httpupload gajim-urlimagepreview gajim-omemo python3-pip pinta curl openjdk-18-jdk
+    container_name: terminalserver
+    hostname: terminalserver
+    restart: on-failure:3
+
+    ports:
+      - "3389:3389"
+      - "2222:22"
+
+    volumes:
+      - ./data/home/:/home/
+      - ./data/ssh/:/etc/ssh/
+      - ./data/opt/:/opt/
+      - /opt/docker/terminalserver/data/users.list:/etc/users.list
+
+    environment:
+            TZ: "Europe/Berlin"
+
+    healthcheck:
+      test: ["CMD", "/bin/nc", "-z", "localhost",  "3389"]
+      interval: 60s
+      timeout: 10s
+      retries: 3
+      start_period: 2m 
+