Browse Source

[Fix-3124][docker]Fix that can not build a docker image on windows (#3765)

pull/3/MERGE
lgcareer 4 years ago committed by GitHub
parent
commit
09bdd99004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      docker/build/hooks/build.bat

13
docker/build/hooks/build.bat

@ -17,15 +17,20 @@
echo "------ dolphinscheduler start - build -------"
set
setlocal enableextensions enabledelayedexpansion
if not defined VERSION (
echo "set environment variable [VERSION]"
for /f %%l in (%cd%\sql\soft_version) do (set VERSION=%%l)
set first=1
for /f "tokens=3 delims=<>" %%a in ('findstr "<version>[0-9].*</version>" %cd%\pom.xml') do (
if !first! EQU 1 (set VERSION=%%a)
set first=0
)
)
if not defined DOCKER_REPO (
echo "set environment variable [DOCKER_REPO]"
set DOCKER_REPO='dolphinscheduler'
set DOCKER_REPO=dolphinscheduler
)
echo "Version: %VERSION%"
@ -40,7 +45,7 @@ if "%errorlevel%"=="1" goto :mvnFailed
:: move dolphinscheduler-bin.tar.gz file to docker/build directory
echo "move %cd%\dolphinscheduler-dist\target\apache-dolphinscheduler-incubating-%VERSION%-SNAPSHOT-dolphinscheduler-bin.tar.gz %cd%\docker\build\"
move %cd%\dolphinscheduler-dist\target\apache-dolphinscheduler-incubating-%VERSION%-SNAPSHOT-dolphinscheduler-bin.tar.gz %cd%\docker\build\
move %cd%\dolphinscheduler-dist\target\apache-dolphinscheduler-incubating-%VERSION%-dolphinscheduler-bin.tar.gz %cd%\docker\build\
:: docker build
echo "docker build --build-arg VERSION=%VERSION% -t %DOCKER_REPO%:%VERSION% %cd%\docker\build\"
@ -53,4 +58,4 @@ echo "------ dolphinscheduler end - build -------"
echo "MAVEN PACKAGE FAILED!"
:dockerBuildFailed
echo "DOCKER BUILD FAILED!"
echo "DOCKER BUILD FAILED!"
Loading…
Cancel
Save