:基於GTK:無法打開顯示:0運行Chromium裏泊塢窗 - 圖形:無法打開顯示:當我嘗試運行泊塢窗容器我看到下面的錯誤中鉻0
Dockerfile:(基於https://registry.hub.docker.com/u/jess/chromium/dockerfile )
FROM debian:jessie
# Install Chromium
RUN sed -i.bak 's/jessie main/jessie main contrib non-free/g' /etc/apt/sources.list && \
apt-get update && apt-get install -y \
chromium \
chromium-l10n \
libcanberra-gtk-module \
libexif-dev \
libpango1.0-0 \
libv4l-0 \
pepperflashplugin-nonfree \
--no-install-recommends && \
mkdir -p /etc/chromium.d/
# Autorun x11vnc
CMD ["/usr/bin/chromium", "--no-sandbox", "--user-data-dir=/data"]
構建和運行:
docker build -t chromium
docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --privileged chromium
和錯誤:
[1:1:0202/085603:ERROR:browser_main_loop.cc(164)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
No protocol specified
[1:1:0202/085603:ERROR:browser_main_loop.cc(210)] Gtk: cannot open display: :0
'xhost +'解決了它。謝謝。 – user3538553 2015-02-09 00:31:31
停止容器,在主機上運行'xhost +'並再次啓動容器對我來說是這樣做的 – GameScripting 2015-07-01 19:40:04
或者你似乎可以執行'xhost + local:docker'來限制性更高。 – 2016-01-06 17:50:50