환경
- 맥 OS 시에라 10.12.6
- Docker 버전 17.09.0-ce, 빌드 afdb6d4
- 우분투 16.04
- X 쿼츠 2.7.9
Docker 컨테이너에서 Mac 데스크톱으로 Chromium 브라우저를 열고 싶습니다.
docker run -i -t ubuntu:16.04 /bin/bash
apt-get update
apt-get install alsa-base chromium-browser xauth
adduser myuser
범하다
docker commit 2862a7bfcc2f acme/mycontainer:0.1
myuser
컨테이너 FAIL에서 와 같이 크롬 브라우저 실행
docker run --user myuser -i -t acme/mycontainer:0.1 /usr/bin/chromium-browser
Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
나는 그것에 조금 더 내기
어떤 포인터?
UDPATE-사용 --privileged
오류를 제거합니다 serverfault의 스레드 참조 하지만 UI가 표시되지 않습니다
docker run \
--privileged \
--user mysuer \
-i -t acme/mycontainer:0.1 /usr/bin/chromium-browser
그리고 이것
docker run \
--privileged \
--net host \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
-e XAUTHORITY=/.Xauthority \
-v ~/.Xauthority:/.Xauthority:ro \
--name chromium \
--user mysuser \
-i -t acme/mycontainer:0.1 /usr/bin/chromium-browser
크롬이 표시되지 않습니다
20171011 업데이트
docker run \
--privileged \
--net host \
-v /tmp/.X11-unix \
-e DISPLAY \
--name chromium \
--user myuser \
-i -t acme/mycontainer:0.1 \
bash
Chromium Gtk: cannot open display: [...] org.macosforge.xquartz:0
오류 시작
$ chromium-browser --verbose
[37:37:1011/154632.348303:VERBOSE1:breakpad_linux.cc(1978)] Breakpad disabled
[1:1:1011/154632.378280:VERBOSE1:zygote_main_linux.cc(537)] ZygoteMain: initializing 0 fork delegates
[1:1:1011/154632.378653:INFO:cpu_info.cc(50)] Available number of cores: 4
[37:37:1011/154632.381303:WARNING:browser_main_loop.cc(275)] Gtk: cannot open display: \
/private/tmp/com.apple.launchd.Y2wR3QWw57/org.macosforge.xquartz:0
내 Mac에서 편집 sshd_config
sudo vim /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10
XAuthLocation /opt/X11/bin/xauth
내 Mac에서 DISPLAY
$ env | grep DISPLAY
DISPLAY=/private/tmp/com.apple.launchd.Y2wR3QWw57/org.macosforge.xquartz:0
디스크에
ls -al /private/tmp/com.apple.launchd.gCYQToI4lb/*
srw-rw-rw- 1 joel wheel 0B Oct 11 17:50
/private/tmp/com.apple.launchd.gCYQToI4lb/org.macosforge.xquartz:0=