-
Notifications
You must be signed in to change notification settings - Fork 92
/
install-docker.bat
50 lines (39 loc) · 1.74 KB
/
install-docker.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
@echo on
@echo =============================================================
@echo $ $
@echo $ Nepxion Thunder $
@echo $ $
@echo $ $
@echo $ $
@echo $ Nepxion Studio All Right Reserved $
@echo $ Copyright (C) 2017-2050 $
@echo $ $
@echo =============================================================
@echo.
@echo off
@title Nepxion Thunder
@color 0a
@set PROJECT_NAME=thunder-spring-boot-docker-example
@set DOCKER_HOST=tcp://localhost:2375
@rem @set DOCKER_CERT_PATH=C:\Users\Neptune\.docker\machine\certs
@set IMAGE_NAME=thunder-service
@set MACHINE_IP=10.0.75.1
@set MACHINE_PORT=6010
@set CONTAINER_PORT=6010
@set RUN_MODE=-i -t
@rem @set RUN_MODE=-d
if exist %PROJECT_NAME%\target rmdir /s/q %PROJECT_NAME%\target
@rem 执行相关模块的Maven Install
call mvn clean install -DskipTests -pl %PROJECT_NAME% -am
@rem 停止和删除Docker容器
call docker stop %IMAGE_NAME%
@rem call docker kill %IMAGE_NAME%
call docker rm %IMAGE_NAME%
@rem 删除Docker镜像
call docker rmi %IMAGE_NAME%
cd %PROJECT_NAME%
@rem 安装Docker镜像
call mvn package docker:build -DskipTests -DImageName=%IMAGE_NAME% -DExposePort=%CONTAINER_PORT% -DThunderHost=%MACHINE_IP% -DThunderPort=%MACHINE_PORT%
@rem 安装和启动Docker容器,并自动执行端口映射
call docker run %RUN_MODE% -p %MACHINE_PORT%:%CONTAINER_PORT% -h %IMAGE_NAME% --name %IMAGE_NAME% %IMAGE_NAME%:latest
pause