目录
Dockerfile
Java版:
build_image.sh
run.sh
一般需要添加 Dockerfile,build_image.sh和run.sh三个文件。
Dockerfile
Java版:
# stage1 build java run image
FROM swr.ap-southeast-3.myhuaweicloud.com/it-common/java-base:oracle-jdk-1.8.0_202-with-awscli-obsutil5.1
#从build_image.sh传进来工程目录
ARG PROJECT_DIR
# stage2 copy run jar file
COPY $PROJECT_DIR/target/*.jar /data/code/
COPY $PROJECT_DIR/run.sh /data/code/run.sh
RUN sudo chmod o+x /data/code/run.sh && \su