update to use i3 instead of openbox
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 29s

This commit is contained in:
Merith 2025-06-05 04:38:43 +00:00
parent eb937f0aab
commit b46f9fccce
3 changed files with 67 additions and 27 deletions

View file

@ -1,33 +1,46 @@
FROM alpine:latest
# Set environment for non-interactive installs
ENV VNC_BUILTIN_WIDTH=1280
ENV VNC_BUILTIN_HEIGHT=720
ENV VNC_BUILTIN_PIXELDEPTH=24
ENV VNC_BUILTIN_DISABLED=false
ENV VNC_BUILTIN_WIDTH=1024
ENV VNC_BUILTIN_HEIGHT=768
ENV VNC_BUILTIN_PIXELDEPTH=32
ENV VNC_BUILTIN_DISABLED=true
ENV DISPLAY=:0
# Install required packages
# Install X/VNC packages
RUN apk add --no-cache \
openbox \
x11vnc \
xvfb \
xterm \
bash \
procps \
iproute2 \
inetutils-telnet \
xdpyinfo \
bash \
wget
# Create working directory
# Create working directory and expose volume for user data
WORKDIR /
# Make sure userdata is stored
VOLUME /root
# Install Fonts
RUN apk add --no-cache \
font-noto \
font-noto-cjk \
font-noto-emoji \
fontconfig
# Copy entrypoint script
# Intall and Setup i3 window manager
RUN apk add --no-cache \
i3wm \
i3blocks \
i3status\
htop
# Copy minimal config
RUN mkdir -p /root/.config/i3
COPY i3.config /root/.config/i3/config
# Copy and prepare entrypoint script
COPY ./vnc.sh /vnc.sh
RUN chmod +x /vnc.sh

29
i3.config Normal file
View file

@ -0,0 +1,29 @@
set $mod Mod1
# Terminal
bindsym $mod+Return exec xterm
# Restart i3 inplace (preserves layout/session)
bindsym $mod+Shift+r restart
# Workspace switching (workspaces 1 to 4)
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
focus_follows_mouse no
# Set default layout tabbed
workspace_layout tabbed
exec /entrypoint.sh
bar {
position top
status_command i3status
}

28
vnc.sh
View file

@ -1,10 +1,10 @@
#!/bin/bash
# Prepare variables
: "${VNC_BUILTIN_WIDTH:=1280}"
: "${VNC_BUILTIN_HEIGHT:=720}"
: "${VNC_BUILTIN_PIXELDEPTH:=24}"
: "${VNC_BUILTIN_DISABLED:=false}"
: "${VNC_BUILTIN_WIDTH:=1024}"
: "${VNC_BUILTIN_HEIGHT:=786}"
: "${VNC_BUILTIN_PIXELDEPTH:=32}"
: "${VNC_BUILTIN_DISABLED:=true}"
if [ "${VNC_BUILTIN_DISABLED}" = true ]; then
echo "Builtin VNC is disabled. You must ensure the DISPLAY variable is set and the target display is accessible"
@ -18,21 +18,19 @@ else
fi
# Wait for the display to become ready
while true
do
if xdpyinfo -display "${DISPLAY}" > /dev/null 2>&1; then
echo "Display ${DISPLAY} is ready!"
break
else
echo "Waiting for display ${DISPLAY} to become ready..."
sleep 0.25
fi
while ! xdpyinfo -display "${DISPLAY}" > /dev/null 2>&1; do
echo "Waiting for display ${DISPLAY} to become ready..."
sleep 1
done
echo "Display ${DISPLAY} is ready!"
# Launch the VNC server if enabled
if [ "${VNC_BUILTIN_DISABLED}" != true ]; then
x11vnc -bg -forever -nopw -display ${DISPLAY} &
fi
# Launch OpenBox
openbox &
# Launch i3 window manager
/usr/bin/i3
echo "i3 exited unexpectedly"
sleep infinity