1

X アプリを実行できる Dockerfile があります。Ubuntu ホストでは完全に動作しますが、Archlinux ホストでは動作しません:

FROM mascip/archlinux:2014.12.09

# To avoid a bug with the filesystem: https://registry.hub.docker.com/u/base/arch/
RUN sed 's/^CheckSpace/#CheckSpace/g' -i /etc/pacman.conf

# BROWSERS
RUN pacman --noconfirm -S nvidia-libgl && pacman --noconfirm -S leafpad

# NON-ROOT USER
# Replace you uid, gid, and username
RUN pacman --noconfirm -S sudo
RUN export uid=1000 gid=1000 && the_user="abla" && \
    the_home="/home/${the_user}" && \
    the_capital_user=$(echo $the_user | sed 's/./\U&/') && \
    mkdir -p $the_home && \
    echo "${the_user}:x:${uid}:${gid}:${the_capital_user},,,:/${the_home}:/bin/bash" >> /etc/passwd && \
    echo "${the_user}:x:${uid}:" >> /etc/group && \
    echo "${the_user} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${the_user} && \
    chmod 0440 /etc/sudoers.d/${the_user} && \
    chown ${the_user}:${the_user} -R ${the_home}

# Replace username and home
ENV USER abla
ENV HOME /home/abla
WORKDIR /home/abla

USER abla

CMD /usr/bin/leafpad

それを実行するには、次のようにします。

$ docker build -t a1 .

$  docker run -ti \
    -e DISPLAY -e XAUTHORITY=/tmp/.Xauthority -v /home/user/.Xauthority:/tmp/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix \
    a1 leafpad

これは Ubuntu では機能します (Leafpad ウィンドウが開きます) が、Arch では機能しません。

leafpad: Cannot open display:

これをすぐに機能させる必要があります。さらに調査するためのアイデアは大歓迎です。

PS: Ubuntu コンテナーでリーフパッドを実行する同様の Docker コンテナーがあります。問題はそのコンテナでもまったく同じです。PPS: Dockerfile はここから派生しています: [url] http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/[/url]

4

1 に答える 1