forked from pubkey/atomjsIDE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.bash
executable file
·62 lines (46 loc) · 1.21 KB
/
run.bash
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
SCRIPT="`readlink -e $0`"
SCRIPTPATH="`dirname $SCRIPT`"
echo $SCRIPTPATH
source ${SCRIPTPATH}/config.bash
# throw if workspace-folder not set
if [ ${WORKSPACE} = "/" ]; then
echo "Please set your workspace-folder at the config.bash"
exit 1
else
echo "## Workspace-folder: ${WORKSPACE}"
fi
MODULENAME="atomjside"
#install docker if not done before
echo "try install docker if not exists"
if which docker >/dev/null; then
echo "docker exists: wont install"
#service docker start
else
echo "docker not exists: i will install"
curl -sSL https://get.docker.com/ | sh
fi
#delete previous container
echo "delete old container"
docker stop $MODULENAME
docker rm $MODULENAME
#build docker image
echo "delete old image: $MODULENAME"
#docker rmi $MODULENAME
echo "building image"
docker build -t $MODULENAME $SCRIPTPATH/docker
#allow xHost
xhost +
#make and run container
echo "make container"
echo "IMPORTANT: DONT close this terminal or atom.io will close"
docker run --name $MODULENAME \
--privileged \
-v $WORKSPACE:/workspace \
-v /tmp/.X11-unix/:/tmp/.X11-unix/ \
-v /dev/shm:/dev/shm \
-v $SCRIPTPATH/mapped:/root/.atom \
-e DISPLAY=${DISPLAY} \
$MODULENAME
#disallow xHost
xhost -