« ^ »
[WIP]

GNOME入りのDockerコンテナからXQuartzに接続する

所要時間: 約 1分
# image: gnome
# ベースイメージを指定します
FROM debian:10

# 環境変数の設定
ENV DEBIAN_FRONTEND noninteractive

# 必要なパッケージをインストールします
RUN apt-get update && \
    apt-get install -y \
        dbus-x11 \
        gnome-core \
        gnome-panel \
        gnome-terminal \
        metacity \
        nautilus \
        --no-install-recommends && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Xサーバーの設定
RUN apt-get update && \
    apt-get install -y \
        xserver-xorg \
        x11-apps && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

ENV DISPLAY :0

RUN echo "export NO_AT_BRIDGE=1" >> /etc/environment
CMD ["dbus-launch", "gnome-session"]

xeyesの確認。

exec docker run -it --rm -e DISPLAY=host.docker.internal:0 gnome xeyes

これは確認できた。

次にgnome-sessionを起動する。

exec docker run --privileged --net=host -it --rm -e DISPLAY=host.docker.internal:0 gnome bash

これはエラーがでる。

,root@docker-desktop:/tmp# gnome-session
,
,(gnome-session-check-accelerated:140): dbind-WARNING **: 09:02:08.160: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
,libGL error: No matching fbConfigs or visuals found
,libGL error: failed to load driver: swrast
,
,(gnome-session-check-accelerated:143): dbind-WARNING **: 09:02:08.302: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
,libGL error: No matching fbConfigs or visuals found
,libGL error: failed to load driver: swrast
,gnome-session-binary[132]: WARNING: software acceleration check failed: Child process exited with code 1
,Unable to init server: Could not connect: Connection refused
,
** (gnome-session-failed:146): WARNING **: 09:02:08.416: Cannot open display: 
,Terminated
,root@docker-desktop:/tmp# echo $DISPLAY
,

ちょっとよくわからないので、時間ができたら続きを調査する。