-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathWindows_1_Build_Run_Containers.bat
51 lines (46 loc) · 1.32 KB
/
Windows_1_Build_Run_Containers.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
@echo off
REM This batch file will start Docker software, build and run containers, and import a SQL dump.
REM Check for Administrator rights
net session >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo This script requires administrator rights. Please run it as an administrator.
pause
exit /b 1
)
echo Starting Docker...
sc query type= service state= all | findstr /I /C:"docker"
if %ERRORLEVEL% == 0 (
net start com.docker.service
if %ERRORLEVEL% == 0 (
echo Docker service started successfully.
) else (
echo Failed to start Docker service. Please check if Docker is installed and you have sufficient permissions.
pause
exit /b 1
)
) else (
echo Docker service not found. Please ensure Docker is installed.
pause
exit /b 1
)
REM Check if Docker daemon is running
docker info >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo Docker daemon is not running. Please start Docker Desktop and ensure the daemon is running.
pause
exit /b 1
)
echo Building and running Docker containers...
docker-compose build
if %ERRORLEVEL% == 0 (
docker-compose up -d
if %ERRORLEVEL% == 0 (
echo Docker containers are up and running.
) else (
echo Failed to start Docker containers.
)
) else (
echo Failed to build Docker containers.
)
echo Process completed.
pause