12-17 0 views
目录结构
1 2 3 4 5 6 |
. ├── Dockerfile # Dockerfile ├── pom.xml …… └── supports └── startup.sh # 启动脚本 |
应用启动脚本
> startup.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/usr/bin/env bash # 应用名称 PROGRAM_NAME=item-center PROGRAM_DIR=/usr/local/${PROGRAM_NAME} PROGRAM_BIN=${PROGRAM_DIR}/${PROGRAM_NAME}.jar JAVA_CMD=java JVM_ARGS="-jar" CMD="${JAVA_CMD} ${JVM_ARGS} ${STARTING_ARGS} ${PROGRAM_BIN}" echo "Starting ..." echo "${CMD}" $CMD |
Dockerfile
> Dockerfile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
FROM registry.cn-shanghai.aliyuncs.com/yr-k8s-test/c7-jdk8u281-base:0.1 ENV WORK_HOME /usr/local/item-center ENV PATH $WORK_HOME/bin:$PATH RUN mkdir -p "$WORK_HOME/bin" RUN export LANG=C.UTF-8 WORKDIR $WORK_HOME COPY ./supports/startup.sh $WORK_HOME/bin/startup.sh COPY ./bin/item-center.jar $WORK_HOME/item-center.jar EXPOSE 9010 EXPOSE 20880 CMD ["sh", "startup.sh"] |
如果想赏钱,可以用微信扫描下面的二维码,一来能刺激我写博客的欲望,二来好维护云主机的费用; 另外再次标注博客原地址 itnotebooks.com 感谢!
