forked from lapwat/nfcscreenoffpatcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontainer_setup.bat
62 lines (62 loc) · 1.39 KB
/
container_setup.bat
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
@echo off
REM set name=patcher-1.1.2
REM set restart=y
:name
if "%name%"=="" (
echo. & echo. & set /P "name=Type a name in lowercase for the patcher, then press ENTER: "
)
if "%name%"=="" (
echo. & echo. & echo --- Please enter something as instructed ---
goto:name
)
:restart
if "%autorestart%"=="" (
echo. & echo. & set /P "autorestart=Type y if you want autorestart enabled for the container, then press ENTER: "
)
if "%autorestart%"=="" (
echo. & echo. & echo --- Please enter something as instructed ---
goto:restart
)
echo.
echo -----
echo Pruning the Docker builder...
echo -----
docker builder prune -f
echo.
echo.
echo -----
echo Building from Dockerfile...
echo -----
docker build --no-cache . -f Dockerfile -t %name%/%name%:latest
echo.
echo.
echo -----
echo Build complete.
echo Running the container in detached mode...
echo -----
docker run -d -p 8000:8000 --name %name% %name%/%name%
if /I %autorestart% EQU "y" (
echo.
echo.
echo -----
echo Stopping the container and setting always restart...
echo -----
docker stop %name%
docker update --restart always %name%
)
echo.
echo.
echo -----
echo Pruning the Docker builder...
echo -----
docker builder prune -f
echo.
echo.
echo -----
echo Finished.
echo.
echo Go to Docker Containers and press the play button to start the container.
echo -----
echo.
pause
exit /b