Skip to content

Instantly share code, notes, and snippets.

@aodag
Created April 5, 2023 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aodag/0154fc637ade893997923b5407fd12ed to your computer and use it in GitHub Desktop.
Save aodag/0154fc637ade893997923b5407fd12ed to your computer and use it in GitHub Desktop.
swayコンポジタをヘッドレスで立ち上げてwayvnc経由で接続可能にするやつ
FROM debian:bookworm
ARG USERNAME=user
ARG GROUPNAME=user
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID $GROUPNAME && \
useradd -m -s /bin/bash -u $UID -g $GID $USERNAME
COPY ./install.sh /usr/local/bin
RUN /bin/bash /usr/local/bin/install.sh
RUN mkdir -p /run/user/$UID
RUN chown ${USERNAME}:${GROUPNAME} /run/user/${UID}
EXPOSE 5900
COPY ./run.sh /usr/local/bin
USER $USERNAME
WORKDIR /home/$USERNAME/
ENTRYPOINT [ "/bin/bash", "run.sh" ]
apt update
apt install -y sway wayvnc xwayland
export WLR_BACKENDS=headless
export WLR_LIBINPUT_NO_DEVICES=1
export WAYLAND_DISPLAY=wayland-1
export XDG_RUNTIME_DIR=/run/user/$(id -u)
sway &
sleep 1
export SWAYSOCK=$(ls $XDG_RUNTIME_DIR/sway-ipc.* | head -n 1)
swaymsg exec foot
exec wayvnc 0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment