mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 20:54:25 +08:00
#I1XCQO 优化docker镜像构建 https://gitee.com/log4j/pig/issues/I1XCQO
This commit is contained in:
parent
3b800f54d4
commit
c4e2bbb8cc
@ -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
|
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
|
COPY --from=builder build/dependencies/ ./
|
||||||
|
COPY --from=builder build/snapshot-dependencies/ ./
|
||||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
COPY --from=builder build/spring-boot-loader/ ./
|
||||||
|
COPY --from=builder build/application/ ./
|
||||||
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
||||||
|
|
||||||
RUN mkdir -p /pig-auth
|
|
||||||
|
|
||||||
WORKDIR /pig-auth
|
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ADD ./target/pig-auth.jar ./
|
CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher
|
||||||
|
|
||||||
CMD sleep 60;java $JAVA_OPTS -jar pig-auth.jar
|
|
@ -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
|
FROM moxm/java:1.8-full
|
||||||
|
LABEL maintainer="jclazz@outlook.com"
|
||||||
MAINTAINER wangiegie@gmail.com
|
|
||||||
|
|
||||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
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
|
COPY --from=builder build/dependencies/ ./
|
||||||
|
COPY --from=builder build/snapshot-dependencies/ ./
|
||||||
RUN mkdir -p /pig-gateway
|
COPY --from=builder build/spring-boot-loader/ ./
|
||||||
|
COPY --from=builder build/application/ ./
|
||||||
WORKDIR /pig-gateway
|
|
||||||
|
|
||||||
EXPOSE 9999
|
EXPOSE 9999
|
||||||
|
|
||||||
ADD ./target/pig-gateway.jar ./
|
CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher
|
||||||
|
|
||||||
CMD sleep 60;java $JAVA_OPTS -jar pig-gateway.jar
|
|
@ -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
|
FROM moxm/java:1.8-full
|
||||||
|
LABEL maintainer="jclazz@outlook.com"
|
||||||
MAINTAINER wangiegie@gmail.com
|
|
||||||
|
|
||||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
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
|
COPY --from=builder build/dependencies/ ./
|
||||||
|
COPY --from=builder build/snapshot-dependencies/ ./
|
||||||
RUN mkdir -p /pig-register
|
COPY --from=builder build/spring-boot-loader/ ./
|
||||||
|
COPY --from=builder build/application/ ./
|
||||||
WORKDIR /pig-register
|
|
||||||
|
|
||||||
EXPOSE 8848
|
EXPOSE 8848
|
||||||
|
|
||||||
ADD ./target/pig-register.jar ./
|
CMD sleep 30; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher
|
||||||
|
|
||||||
CMD sleep 30;java $JAVA_OPTS -jar pig-register.jar
|
|
||||||
|
|
||||||
|
|
@ -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
|
FROM moxm/java:1.8-full
|
||||||
|
LABEL maintainer="jclazz@outlook.com"
|
||||||
MAINTAINER wangiegie@gmail.com
|
|
||||||
|
|
||||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
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
|
COPY --from=builder build/dependencies/ ./
|
||||||
|
COPY --from=builder build/snapshot-dependencies/ ./
|
||||||
RUN mkdir -p /pig-upms
|
COPY --from=builder build/spring-boot-loader/ ./
|
||||||
|
COPY --from=builder build/application/ ./
|
||||||
WORKDIR /pig-upms
|
|
||||||
|
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|
||||||
ADD ./target/pig-upms-biz.jar ./
|
CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher
|
||||||
|
|
||||||
CMD sleep 60;java $JAVA_OPTS -jar pig-upms-biz.jar
|
|
@ -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
|
FROM moxm/java:1.8-full
|
||||||
|
LABEL maintainer="jclazz@outlook.com"
|
||||||
MAINTAINER wangiegie@gmail.com
|
|
||||||
|
|
||||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
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
|
COPY --from=builder build/dependencies/ ./
|
||||||
|
COPY --from=builder build/snapshot-dependencies/ ./
|
||||||
RUN mkdir -p /pig-codegen
|
COPY --from=builder build/spring-boot-loader/ ./
|
||||||
|
COPY --from=builder build/application/ ./
|
||||||
WORKDIR /pig-codegen
|
|
||||||
|
|
||||||
EXPOSE 5002
|
EXPOSE 5002
|
||||||
|
|
||||||
ADD ./target/pig-codegen.jar ./
|
CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher
|
||||||
|
|
||||||
CMD sleep 60;java $JAVA_OPTS -jar pig-codegen.jar
|
|
@ -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
|
FROM moxm/java:1.8-full
|
||||||
|
LABEL maintainer="jclazz@outlook.com"
|
||||||
MAINTAINER wangiegie@gmail.com
|
|
||||||
|
|
||||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
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
|
COPY --from=builder build/dependencies/ ./
|
||||||
|
COPY --from=builder build/snapshot-dependencies/ ./
|
||||||
RUN mkdir -p /pig-monitor
|
COPY --from=builder build/spring-boot-loader/ ./
|
||||||
|
COPY --from=builder build/application/ ./
|
||||||
WORKDIR /pig-monitor
|
|
||||||
|
|
||||||
EXPOSE 5001
|
EXPOSE 5001
|
||||||
|
|
||||||
ADD ./target/pig-monitor.jar ./
|
CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher
|
||||||
|
|
||||||
CMD sleep 60;java $JAVA_OPTS -jar pig-monitor.jar
|
|
@ -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
|
FROM moxm/java:1.8-full
|
||||||
|
LABEL maintainer="jclazz@outlook.com"
|
||||||
MAINTAINER wangiegie@gmail.com
|
|
||||||
|
|
||||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
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
|
COPY --from=builder build/dependencies/ ./
|
||||||
|
COPY --from=builder build/snapshot-dependencies/ ./
|
||||||
RUN mkdir -p /pig-sentinel-dashboard
|
COPY --from=builder build/spring-boot-loader/ ./
|
||||||
|
COPY --from=builder build/application/ ./
|
||||||
WORKDIR /pig-sentinel-dashboard
|
|
||||||
|
|
||||||
EXPOSE 5003
|
EXPOSE 5003
|
||||||
|
|
||||||
ADD ./target/pig-sentinel-dashboard.jar ./
|
CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher
|
||||||
|
|
||||||
CMD sleep 60;java $JAVA_OPTS -jar pig-sentinel-dashboard.jar
|
|
@ -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
|
FROM moxm/java:1.8-full
|
||||||
|
LABEL maintainer="jclazz@outlook.com"
|
||||||
MAINTAINER wangiegie@gmail.com
|
|
||||||
|
|
||||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
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
|
COPY --from=builder build/dependencies/ ./
|
||||||
|
COPY --from=builder build/snapshot-dependencies/ ./
|
||||||
RUN mkdir -p /pig-xxl-job-admin
|
COPY --from=builder build/spring-boot-loader/ ./
|
||||||
|
COPY --from=builder build/application/ ./
|
||||||
WORKDIR /pig-xxl-job-admin
|
|
||||||
|
|
||||||
EXPOSE 5004
|
EXPOSE 5004
|
||||||
|
|
||||||
ADD ./target/pig-xxl-job-admin.jar ./
|
CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher
|
||||||
|
|
||||||
CMD sleep 60;java $JAVA_OPTS -jar pig-xxl-job-admin.jar
|
|
3
pom.xml
3
pom.xml
@ -187,6 +187,9 @@
|
|||||||
<version>${spring-boot.version}</version>
|
<version>${spring-boot.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.build.finalName}</finalName>
|
<finalName>${project.build.finalName}</finalName>
|
||||||
|
<layers>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</layers>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
Loading…
Reference in New Issue
Block a user