Skip to content

Instantly share code, notes, and snippets.

@kawaz
Created February 3, 2020 05:55
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 kawaz/b67c6b24bb6892960d06218e0d33c7c0 to your computer and use it in GitHub Desktop.
Save kawaz/b67c6b24bb6892960d06218e0d33c7c0 to your computer and use it in GitHub Desktop.
MacでDocker内のXアプリケーションを実行する手順
# MacにXサーバを入れる(XQuartsの設定→セキュリティ→ネットワーククライアントからの接続を許可をチェックする)
brew cask install xquartz
# XQuarts で OpenGL を使えるようにする
defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
# デモ用のイメージを作成
docker build -t xdemo -f <(echo $'FROM alpine\nRUN apk --no-cache add xeyes mesa-demos') .
# デモを実行してみる
docker run --rm -e DISPLAY=$(hostname):0 -v ~/.Xauthority:/root/.Xauthority xdemo xeyes
docker run --rm -e DISPLAY=$(hostname):0 -v ~/.Xauthority:/root/.Xauthority xdemo xeyes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment