From d25eb18544326575e0e907f2b5b539a139621d21 Mon Sep 17 00:00:00 2001 From: huaairen Date: Thu, 9 Apr 2020 19:49:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0docker=E6=89=93=E5=8C=85?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E7=9A=84=E9=85=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 ++++++--- pom.xml | 12 +++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 521ebe3..5a4148c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ -FROM openjdk:8-jdk-alpine +#基础配置 +FROM daocloud.io/library/java:8u40-b22 VOLUME /tmp ARG JAR_FILE -COPY ${JAR_FILE} app.jar +ADD ${JAR_FILE} /home/app.jar +ADD src/main/resources/application.properties /home/conf/application.properties +WORKDIR /home/ EXPOSE 8082 -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] +ENTRYPOINT ["java","-jar","-Dspring.config.location=conf/application.properties","./app.jar"] diff --git a/pom.xml b/pom.xml index f95f20d..b9f6c16 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,7 @@ UTF-8 1.8 kuaidi + kuaidi @@ -132,11 +133,16 @@ com.spotify - docker-maven-plugin - 1.0.0 + dockerfile-maven-plugin + 1.4.6 ${docker.image.prefix}/${project.artifactId} - src/main/docker + ${project.basedir} + ${project.version} + ${docker.images.repository}/${project.artifactId} + + target/${project.build.finalName}.jar + /