forked from stockmind/gpd-pocket-ubuntu-respin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-build-kernel.bat
39 lines (32 loc) · 1.09 KB
/
docker-build-kernel.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
@ECHO OFF
ECHO "File: %~1"
SET SCRIPTPATH=%~dp0
ECHO "Script dir: "%SCRIPTPATH%
SET INPUTDIR=%SCRIPTPATH%origin
SET OUTPUTDIR=%SCRIPTPATH%destination
if not exist "%SCRIPTPATH%origin" mkdir %SCRIPTPATH%origin
if not exist "%SCRIPTPATH%destination" mkdir %SCRIPTPATH%destination
ECHO "Input dir: "%INPUTDIR%
ECHO "Output dir: "%OUTPUTDIR%
docker image inspect stockmind/gpd-pocket-ubuntu-respin:latest >NUL
IF errorlevel 1 (
ECHO "Docker hub image not found!"
docker image inspect gpd-pocket-ubuntu-respin:latest >NUL
IF errorlevel 1 (
ECHO "Local Docker image not found!"
echo "Build docker image or download it from Docker Hub with 'docker pull stockmind/gpd-pocket-ubuntu-respin'!"
pause
exit 1
) ELSE (
ECHO "Local Docker image found!"
SET IMAGENAME="gpd-pocket-ubuntu-respin"
)
) ELSE (
ECHO "Docker hub image found!"
SET IMAGENAME="stockmind/gpd-pocket-ubuntu-respin"
)
REM CLEAN OLD CONTAINER
docker rm gpd-pocket-kernel-container
REM RUN KERNEL BUILD
docker run -t -v %INPUTDIR%:/docker-input -v %OUTPUTDIR%:/docker-output --name gpd-pocket-kernel-container %IMAGENAME% kernel
pause