Powered by
This repository contains Docker configuration to build X11/Wayland Chromium image.
- Docker
- Docker compose (optional)
- Git
- X11 or Wayland running environment
# Import
git clone https://github.com/IACA-Dev/docker-chromium.git
cd docker-chromium
# Build
docker build -t docker-chromium .docker run \
--rm -i \
-v <xauthority-dir>:/mnt/xauthority.d \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e XAUTHORITY=/mnt/xauthority.d/Xauthority \
-e DISPLAY=$DISPLAY \
--net=host \
iacaelectronique/chromium <target-url>docker run \
-e XDG_RUNTIME_DIR=<run-dir> \
-e WAYLAND_DISPLAY=wayland-0 \
-v <run-dir>:<run-dir> \
-v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket \
-u "0:0" \
--privileged \
iacaelectronique/chromium --no-sandbox \
--ozone-platform=wayland \
--chrome-frame --kiosk <url>-
Wayland Environment Variables:
XDG_RUNTIME_DIR: Directory for Wayland runtime data (in example it's<run-dir>for the current user).WAYLAND_DISPLAY: Name of the Wayland display socket (wayland-0is common).
-
Volume Mapping:
<run-dir>:<run-dir>: Maps the Wayland runtime directory into the container./var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket: Connects the container to the system D-Bus socket, allowing for system-level communication like device or service event handling.
-
User Adjustments:
-u "0:0": Ensures that the container runs with elevated privileges.
-
Privileged Mode:
--privileged: Required for kiosk setups to enable features like input and device handling.
-
Browser Flags:
--no-sandbox: Disables the browser's sandbox security. Use only if absolutely necessary.--ozone-platform=wayland: Explicitly specifies Wayland as the graphics platform.--chrome-frame: Enables a borderless, frameless browser window.--kiosk <target-url>: Launches the browser in kiosk mode, displaying the specified URL.
xhost + local:docker
docker run \
--rm -i \
-v /home/pi:/mnt/xauthority.d \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e XAUTHORITY=/mnt/xauthority.d/Xauthority \
-e DISPLAY=$DISPLAY \
--net=host \
iacaelectronique/x11-chromium www.google.com- Julien FAURE ✉️ julien.faure@iaca-electronique.com (IACA Electronique)