darkdragon-001 / Dockerfile-Ubuntu-Gnome

MIT License
32 stars 20 forks source link

Change VNC settings via environment variable #1

Open darkdragon-001 opened 5 years ago

darkdragon-001 commented 5 years ago
mviereck commented 5 years ago

environment variables need to be handled specifically in systemd services

You can specify environment variables for all systemd services in /etc/systemd/system.conf.d/myenvvars.conf. x11docker creates such a file and shares it with the container. Sample file content:

[Manager]
DefaultEnvironment=container=docker XAUTHORITY=/x11docker/Xclientcookie DISPLAY=:252 XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR 

All variables must be in one line. I don't understand this entirely, but it works.


Edit: systemd clears all environment variables set with --env. Alternatively, the image could be set up with runit, dbus and elogind to allow --env again. runit replaces systemd and elogind replaces systemd-logind. Basically Gnome 3 needs a logind service and DBus.

Edit2: Thinking again about this: Maybe not a great idea. elogind needs a cgroup that needs either to be mounted on host or created in container with capability SYS_ADMIN.