forked from MurpheyLab/MaxDiffRL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_docker.bat
20 lines (15 loc) · 863 Bytes
/
run_docker.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@echo off
setlocal EnableDelayedExpansion
SET container=test
SET image=maxdiff
SET port=6080
SET url=http://localhost:%port%
echo Checking for docker image...
docker images -q %image% |findstr . > nul 2>&1 && set placeholder=blah || ( echo Building image... & docker build -t %image% --label latest . & set placeholder=blah )
echo Checking for docker container...
docker ps -a -q --filter name=%container% > nul 2>&1 && (echo Stopping and removing the previous session... & docker stop %container% > nul 2>&1 & docker rm %container% > nul 2>&1) || set placeholder=blah
echo Setting up the graphical application container...
echo:
echo Point your web browser to %url%
echo When ready to end docker session, close terminal
docker run -d --name %container% -v docker_test_results:/home/user/work/results -p %port%:6080 --env "APP=xterm" %image% > nul 2>&1