將工程包單獨掛載出來, 運行環境依然打成鏡像.nginx
docker run -d --restart=always \ --net huoshu --ip 172.21.1.4 -p 8380:8380 \ -e ORACLE_ADDR=172.16.4.101 \ -v /opt/apps/etlloader:/opt/etlloader \ -v /var/log/etlloader:/opt/etlloader/consolelog \ reg01.sky-mobi.com/huoshu/etlloader-separate:1.0.0
/opt/apps/etlloader
的目錄結構web
. ├── exe.jar├── exe.sh├── run.jar└── run.sh
因爲webapps目錄下的訪問路徑與工程包名不一樣, 因此須要事先將war包解壓, 而不是選擇在tomcat啓動時自動解壓.docker
...宿主機上不必定有jdk, jar
命令不能用, 仍是打成tar包再上傳吧.apache
hdc-manager
tomcat
war包解壓後放在/opt/apps
目錄下, 即工程全路徑爲/opt/apps/hdc-manager
app
docker run -d --restart=always \ --net huoshu --ip=172.21.1.2 -p 8180:8080 \ -v /opt/apps/hdc-manager:/usr/local/apache-tomcat-8.5.4/webapps/se \ -v /var/log/hdc-manager:/usr/local/apache-tomcat-8.5.4/logs \ -e ORACLE_ADDR=172.16.4.101 \ reg01.sky-mobi.com/huoshu/tomcat:latest
skydata-se
webapp
war包解壓後放在/opt/apps
目錄下, 即工程全路徑爲/opt/apps/skydata-se
jsp
docker run -d --restart=always \ --net huoshu --ip=172.21.1.3 -p 8280:8080 \ -v /opt/apps/skydata-se:/usr/local/apache-tomcat-8.5.4/webapps/skydata \ -v /var/log/skydata-se:/usr/local/apache-tomcat-8.5.4/logs \ -e ORACLE_ADDR=172.16.4.101 \ reg01.sky-mobi.com/huoshu/tomcat:latest
最終/opt/apps
目錄的成員以下ide
front ├── bi_FE ├── hdc_FE └── nginx.conf.d ├── bi.conf └── hdc.confhdc-manager ├── index.jsp ├── META-INF └── WEB-INFskydata-se ├── index.jsp ├── execl ├── META-INF └── WEB-INFetlloader ├── exe.jar ├── exe.sh ├── run.jar └── run.sh