-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (43 loc) · 1.54 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (43 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Use the official Arch Linux base image
FROM docker.io/archlinux:latest
# 1. Update Keyrings and System
# Arch relies on rolling crypto keys. We must update 'archlinux-keyring' first
# to avoid "invalid signature" errors during the build.
RUN pacman -Sy --noconfirm archlinux-keyring && \
pacman -Syu --noconfirm
# 2. Install Dependencies
# - mesa: OpenGL/Vulkan drivers for Intel/AMD
# - xorg-xwayland: For running X11 apps inside Wayland
# - qt6-base, qt6-wayland: The UI framework and its Wayland plugin
# - opencv: Computer vision library (Arch package is very comprehensive)
# - sdl2, glfw: Graphics/Input libraries (Arch's 'glfw' supports Wayland out-of-the-box)
# - base-devel, git, cmake: Compilers and build tools
RUN pacman -S --noconfirm \
mesa \
vulkan-intel \
vulkan-radeon \
xorg-xwayland \
xorg-xauth \
qt6-base \
qt6-wayland \
opencv \
sdl2 \
glfw \
base-devel \
git \
cmake \
&& pacman -Scc --noconfirm # Clean up cache to save space
# 3. Set up a non-root user
# We add the user to 'video' for hardware acceleration access
RUN useradd -u 1000 -m -G video developer
# 4. Environment Variables
# Tell Qt to try Wayland first, then fall back to X11 (xcb)
ENV QT_QPA_PLATFORM="wayland;xcb"
ENV XDG_RUNTIME_DIR="/run/user/1000"
RUN pacman -S --noconfirm sudo
# Allow 'developer' to use sudo without a password
RUN echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer
# 5. Switch context
USER developer
WORKDIR /home/developer
# Allow 'developer' to use sudo without a password