目录/opt/docker/jenkins/data/script/java
创建文件dockerfile
FROM java:8
ARG spring_active
ARG project_name
ARG server_port
ENV project_name ${project_name}
ENV spring_active ${spring_active}
RUN mkdir -p /data/${project_name}
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/shanghai" > /etc/timezone
COPY *.jar /data/${project_name}/
COPY script_start.sh /data/${project_name}/
WORKDIR /data/${project_name}
EXPOSE $server_prot
ENTRYPOINT ["./script_start.sh"]
创建文件 script_start.sh
#!/bin/bash
java -jar ${project_name}.jar --spring.profiles.active=${spring_active}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)