2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

macosにてdocker上にwineを実行

Last updated at Posted at 2020-07-18

macosでwineを動かすのが難しそうだったので docker経由で実行するスクリプトを作成

環境

macOS Catalina 10.15.5
Docker desktop 2.3.0.3
Microsoft Remote Desktop 10.3.12

概要

https://hub.docker.com/r/scottyhardy/docker-wine/
のイメージを実行して, RDPで使用する

"Documents/Docker/winedir/" フォルダをwineと共有する

準備

  • Docker desktop と
  • Microsoft Remote Desktop をインストール

https://hub.docker.com/r/scottyhardy/docker-wine/
から
docker-wine スクリプトをダウンロードして
Documents/Docker/ に置く

cd Documents/Docker/
curl -O https://raw.githubusercontent.com/scottyhardy/docker-wine/master/docker-wine
chmod +x docker-wine

起動スクリプト

runwine.command を Documents/Docker/ に置き,
ターミナルで実行権限をつける

chmod +x runwine.command
runwine.command
#!/bin/zsh

# https://hub.docker.com/r/scottyhardy/docker-wine/

open "/Applications/Docker.app"
echo -n "waiting"
# Docker.appが起動するまで待つ
while ! docker system info >/dev/null 2>&1; do
    echo -n  "." && sleep 5
done
echo "."

open "/Applications/Microsoft Remote Desktop.app"

docdir=$HOME/Documents/Docker
if [ ! -f $docdir ]; then
    docdir=$HOME/Library/Mobile\ Documents/com~apple~CloudDocs/Documents/Docker
fi
cd $docdir && ./docker-wine  --volume="$docdir/winedir:/home/wineuser/winedir" --rdp

使用

  1. runwine.command をダブルクリック
  2. Docker.app と Microsoft Remote Desktop が起動
  3. docker-wine が起動するまで待つ(ターミナル.app で xrdp関係の表示出るまで)
  4. Microsoft Remote Desktop から docker-wine にwineuserユーザで接続(証明書の警告が出るが continue)
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?