forked from giongto35/cloud-morph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-wine.sh
executable file
·37 lines (37 loc) · 1.23 KB
/
run-wine.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
cd winvm
docker build -t syncwine .
docker rm -f appvm
if [ $(uname -s) == "Darwin" ]
then
echo "Spawn container on Mac"
docker run -d --privileged --rm --name "appvm" \
--mount type=bind,source="$(pwd)"/apps,target=/apps \
--mount type=bind,source="$(pwd)"/supervisord.conf,target=/etc/supervisor/conf.d/supervisord.conf \
--env "apppath=$1" \
--env "appfile=$2" \
--env "appname=$3" \
--env "hwkey=$4" \
--env "screenwidth=$5" \
--env "screenheight=$6" \
--env "wineoptions=$7" \
--env "dockerhost=host.docker.internal" \
--env "DISPLAY=:99" \
--volume "winecfg:/root/.wine" syncwine supervisord
else
echo "Spawn container on Linux"
docker run -t -d --privileged --rm --name "appvm" \
--mount type=bind,source="$(pwd)"/apps,target=/apps \
--mount type=bind,source="$(pwd)"/supervisord.conf,target=/etc/supervisor/conf.d/supervisord.conf \
--network=host \
--env "apppath=$1" \
--env "appfile=$2" \
--env "appname=$3" \
--env "hwkey=$4" \
--env "screenwidth=$5" \
--env "screenheight=$6" \
--env "wineoptions=$7" \
--env "dockerhost=127.0.0.1" \
--env "DISPLAY=:99" \
--volume "winecfg:/root/.wine" syncwine supervisord
fi