From c4e2bbb8cc242f25b9dca11fb38807c5ce1c3372 Mon Sep 17 00:00:00 2001 From: cj Date: Thu, 1 Oct 2020 17:17:03 +0800 Subject: [PATCH] =?UTF-8?q?#I1XCQO=20=E4=BC=98=E5=8C=96docker=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=9E=84=E5=BB=BA=20https://gitee.com/log4j/pig/issue?= =?UTF-8?q?s/I1XCQO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pig-auth/Dockerfile | 27 +++++++++++--------- pig-gateway/Dockerfile | 24 +++++++++-------- pig-register/Dockerfile | 26 +++++++++---------- pig-upms/pig-upms-biz/Dockerfile | 24 +++++++++-------- pig-visual/pig-codegen/Dockerfile | 24 +++++++++-------- pig-visual/pig-monitor/Dockerfile | 24 +++++++++-------- pig-visual/pig-sentinel-dashboard/Dockerfile | 24 +++++++++-------- pig-visual/pig-xxl-job-admin/Dockerfile | 24 +++++++++-------- pom.xml | 3 +++ 9 files changed, 109 insertions(+), 91 deletions(-) diff --git a/pig-auth/Dockerfile b/pig-auth/Dockerfile index 4a01a058..1293c2be 100755 --- a/pig-auth/Dockerfile +++ b/pig-auth/Dockerfile @@ -1,17 +1,20 @@ +FROM openjdk:8-jre as builder +WORKDIR build +ARG JAR_FILE=target/pig-auth.jar +COPY ${JAR_FILE} app.jar +RUN java -Djarmode=layertools -jar app.jar extract && rm app.jar + FROM moxm/java:1.8-full +LABEL maintainer="jclazz@outlook.com" +ENV TZ=Asia/Shanghai +ENV JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" +WORKDIR pig-auth -MAINTAINER wangiegie@gmail.com - -ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" - -RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN mkdir -p /pig-auth - -WORKDIR /pig-auth +COPY --from=builder build/dependencies/ ./ +COPY --from=builder build/snapshot-dependencies/ ./ +COPY --from=builder build/spring-boot-loader/ ./ +COPY --from=builder build/application/ ./ EXPOSE 3000 -ADD ./target/pig-auth.jar ./ - -CMD sleep 60;java $JAVA_OPTS -jar pig-auth.jar +CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher \ No newline at end of file diff --git a/pig-gateway/Dockerfile b/pig-gateway/Dockerfile index d8399c2a..c96e071a 100755 --- a/pig-gateway/Dockerfile +++ b/pig-gateway/Dockerfile @@ -1,17 +1,19 @@ +FROM openjdk:8-jre as builder +WORKDIR build +ARG JAR_FILE=target/pig-gateway.jar +COPY ${JAR_FILE} app.jar +RUN java -Djarmode=layertools -jar app.jar extract && rm app.jar + FROM moxm/java:1.8-full - -MAINTAINER wangiegie@gmail.com - +LABEL maintainer="jclazz@outlook.com" ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" +WORKDIR pig-gateway -RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN mkdir -p /pig-gateway - -WORKDIR /pig-gateway +COPY --from=builder build/dependencies/ ./ +COPY --from=builder build/snapshot-dependencies/ ./ +COPY --from=builder build/spring-boot-loader/ ./ +COPY --from=builder build/application/ ./ EXPOSE 9999 -ADD ./target/pig-gateway.jar ./ - -CMD sleep 60;java $JAVA_OPTS -jar pig-gateway.jar +CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher \ No newline at end of file diff --git a/pig-register/Dockerfile b/pig-register/Dockerfile index d452a6ce..aff18413 100644 --- a/pig-register/Dockerfile +++ b/pig-register/Dockerfile @@ -1,19 +1,19 @@ +FROM openjdk:8-jre as builder +WORKDIR build +ARG JAR_FILE=target/pig-register.jar +COPY ${JAR_FILE} app.jar +RUN java -Djarmode=layertools -jar app.jar extract && rm app.jar + FROM moxm/java:1.8-full - -MAINTAINER wangiegie@gmail.com - +LABEL maintainer="jclazz@outlook.com" ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" +WORKDIR pig-register -RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN mkdir -p /pig-register - -WORKDIR /pig-register +COPY --from=builder build/dependencies/ ./ +COPY --from=builder build/snapshot-dependencies/ ./ +COPY --from=builder build/spring-boot-loader/ ./ +COPY --from=builder build/application/ ./ EXPOSE 8848 -ADD ./target/pig-register.jar ./ - -CMD sleep 30;java $JAVA_OPTS -jar pig-register.jar - - +CMD sleep 30; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher \ No newline at end of file diff --git a/pig-upms/pig-upms-biz/Dockerfile b/pig-upms/pig-upms-biz/Dockerfile index 63d5ee3c..43a4484a 100644 --- a/pig-upms/pig-upms-biz/Dockerfile +++ b/pig-upms/pig-upms-biz/Dockerfile @@ -1,17 +1,19 @@ +FROM openjdk:8-jre as builder +WORKDIR build +ARG JAR_FILE=target/pig-upms-biz.jar +COPY ${JAR_FILE} app.jar +RUN java -Djarmode=layertools -jar app.jar extract && rm app.jar + FROM moxm/java:1.8-full - -MAINTAINER wangiegie@gmail.com - +LABEL maintainer="jclazz@outlook.com" ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" +WORKDIR pig-upms -RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN mkdir -p /pig-upms - -WORKDIR /pig-upms +COPY --from=builder build/dependencies/ ./ +COPY --from=builder build/snapshot-dependencies/ ./ +COPY --from=builder build/spring-boot-loader/ ./ +COPY --from=builder build/application/ ./ EXPOSE 4000 -ADD ./target/pig-upms-biz.jar ./ - -CMD sleep 60;java $JAVA_OPTS -jar pig-upms-biz.jar +CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher \ No newline at end of file diff --git a/pig-visual/pig-codegen/Dockerfile b/pig-visual/pig-codegen/Dockerfile index a5a5196f..f32a3c04 100644 --- a/pig-visual/pig-codegen/Dockerfile +++ b/pig-visual/pig-codegen/Dockerfile @@ -1,17 +1,19 @@ +FROM openjdk:8-jre as builder +WORKDIR build +ARG JAR_FILE=target/pig-codegen.jar +COPY ${JAR_FILE} app.jar +RUN java -Djarmode=layertools -jar app.jar extract && rm app.jar + FROM moxm/java:1.8-full - -MAINTAINER wangiegie@gmail.com - +LABEL maintainer="jclazz@outlook.com" ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" +WORKDIR pig-codegen -RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN mkdir -p /pig-codegen - -WORKDIR /pig-codegen +COPY --from=builder build/dependencies/ ./ +COPY --from=builder build/snapshot-dependencies/ ./ +COPY --from=builder build/spring-boot-loader/ ./ +COPY --from=builder build/application/ ./ EXPOSE 5002 -ADD ./target/pig-codegen.jar ./ - -CMD sleep 60;java $JAVA_OPTS -jar pig-codegen.jar +CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher \ No newline at end of file diff --git a/pig-visual/pig-monitor/Dockerfile b/pig-visual/pig-monitor/Dockerfile index 7e557809..7d0da58d 100755 --- a/pig-visual/pig-monitor/Dockerfile +++ b/pig-visual/pig-monitor/Dockerfile @@ -1,17 +1,19 @@ +FROM openjdk:8-jre as builder +WORKDIR build +ARG JAR_FILE=target/pig-monitor.jar +COPY ${JAR_FILE} app.jar +RUN java -Djarmode=layertools -jar app.jar extract && rm app.jar + FROM moxm/java:1.8-full - -MAINTAINER wangiegie@gmail.com - +LABEL maintainer="jclazz@outlook.com" ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" +WORKDIR pig-monitor -RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN mkdir -p /pig-monitor - -WORKDIR /pig-monitor +COPY --from=builder build/dependencies/ ./ +COPY --from=builder build/snapshot-dependencies/ ./ +COPY --from=builder build/spring-boot-loader/ ./ +COPY --from=builder build/application/ ./ EXPOSE 5001 -ADD ./target/pig-monitor.jar ./ - -CMD sleep 60;java $JAVA_OPTS -jar pig-monitor.jar +CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher \ No newline at end of file diff --git a/pig-visual/pig-sentinel-dashboard/Dockerfile b/pig-visual/pig-sentinel-dashboard/Dockerfile index f2c5b198..830f9d1c 100644 --- a/pig-visual/pig-sentinel-dashboard/Dockerfile +++ b/pig-visual/pig-sentinel-dashboard/Dockerfile @@ -1,17 +1,19 @@ +FROM openjdk:8-jre as builder +WORKDIR build +ARG JAR_FILE=target/pig-sentinel-dashboard.jar +COPY ${JAR_FILE} app.jar +RUN java -Djarmode=layertools -jar app.jar extract && rm app.jar + FROM moxm/java:1.8-full - -MAINTAINER wangiegie@gmail.com - +LABEL maintainer="jclazz@outlook.com" ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" +WORKDIR pig-sentinel-dashboard -RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN mkdir -p /pig-sentinel-dashboard - -WORKDIR /pig-sentinel-dashboard +COPY --from=builder build/dependencies/ ./ +COPY --from=builder build/snapshot-dependencies/ ./ +COPY --from=builder build/spring-boot-loader/ ./ +COPY --from=builder build/application/ ./ EXPOSE 5003 -ADD ./target/pig-sentinel-dashboard.jar ./ - -CMD sleep 60;java $JAVA_OPTS -jar pig-sentinel-dashboard.jar +CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher \ No newline at end of file diff --git a/pig-visual/pig-xxl-job-admin/Dockerfile b/pig-visual/pig-xxl-job-admin/Dockerfile index f4b660e4..f0fd2bb4 100644 --- a/pig-visual/pig-xxl-job-admin/Dockerfile +++ b/pig-visual/pig-xxl-job-admin/Dockerfile @@ -1,17 +1,19 @@ +FROM openjdk:8-jre as builder +WORKDIR build +ARG JAR_FILE=target/pig-xxl-job-admin.jar +COPY ${JAR_FILE} app.jar +RUN java -Djarmode=layertools -jar app.jar extract && rm app.jar + FROM moxm/java:1.8-full - -MAINTAINER wangiegie@gmail.com - +LABEL maintainer="jclazz@outlook.com" ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" +WORKDIR pig-xxl-job-admin -RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN mkdir -p /pig-xxl-job-admin - -WORKDIR /pig-xxl-job-admin +COPY --from=builder build/dependencies/ ./ +COPY --from=builder build/snapshot-dependencies/ ./ +COPY --from=builder build/spring-boot-loader/ ./ +COPY --from=builder build/application/ ./ EXPOSE 5004 -ADD ./target/pig-xxl-job-admin.jar ./ - -CMD sleep 60;java $JAVA_OPTS -jar pig-xxl-job-admin.jar +CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher \ No newline at end of file diff --git a/pom.xml b/pom.xml index f4f0d6fa..e0a351a9 100755 --- a/pom.xml +++ b/pom.xml @@ -187,6 +187,9 @@ ${spring-boot.version} ${project.build.finalName} + + true +