From 791dc429d3c1457f8430f6c8356fef6caffdd8fb Mon Sep 17 00:00:00 2001 From: Simon Zeyer Date: Wed, 30 Oct 2024 23:06:35 +0100 Subject: [PATCH] init x11 docker --- .gitignore | 1 + Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ docker-compose.yaml | 9 +++++++++ 3 files changed, 50 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c01e6d3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM ubuntu:oracular + +# Decrease number of pacakges +RUN apt-get update && \ + DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends xorg xserver-xorg-input-evdev xserver-xorg-input-all + +# TODO: keyboard should be configurable in runtime +# TODO: actually move all input related functionality to separate layer +#RUN printf "\ +#Section \"ServerFlags\"\n\ +# Option \"AutoAddDevices\" \"False\"\n\ +#EndSection\n\ +#\n\ +#Section \"ServerLayout\"\n\ +# Identifier \"Desktop\"\n\ +# InputDevice \"Mouse0\" \"CorePointer\"\n\ +# InputDevice \"Keyboard0\" \"CoreKeyboard\"\n\ +#EndSection\n\ +#\n\ +#Section \"InputDevice\"\n\ +# Identifier \"Keyboard0\"\n\ +# Option \"CoreKeyboard\"\n\ +# Option \"Device\" \"/dev/input/event4\"\n\ +# Driver \"evdev\"\n\ +#EndSection\n\ +#\n\ +#Section \"InputDevice\"\n\ +# Identifier \"Mouse0\"\n\ +# Driver \"mouse\"\n\ +# Option \"Protocol\" \"auto\"\n\ +# Option \"Device\" \"/dev/input/mice\"\n\ +# Option \"ZAxisMapping\" \"4 5 6 7\"\n\ +#EndSection\n\ +#" > /etc/X11/xorg.conf.d/10-input.conf +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - +RUN sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' +RUN apt-get update +RUN DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends google-chrome-stable +CMD /usr/bin/xinit google-chrome --kiosk --no-first-run --suppress-message-center-popups --block-new-web-contents --no-default-browser-check --password-store=basic --ignore-certificate-errors --ignore-ssl-errors --simulate-outdated-no-au='Tue, 31 Dec 2199 23:59:59 GMT' "$URL" -- :0 -nolisten tcp vt1 +#CMD /usr/bin/X :0 -nolisten tcp vt1 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..7afec91 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +version: "2" +services: + app: + build: ./ + image: gitea.simonzeyer.de/simon/x11-kiosk:latest + restart: always + privileged: true + environment: + - url=${url}