Browse Source

🎉 增加dockerfile新写法

test
smallchill 5 years ago
parent
commit
a31eb1d3eb
  1. 11
      blade-service/blade-demo/Dockerfile
  2. 18
      blade-service/blade-demo/pom.xml
  3. 24
      pom.xml

11
blade-service/blade-demo/Dockerfile

@ -2,6 +2,15 @@ FROM anapsix/alpine-java:8_server-jre_unlimited
MAINTAINER smallchill@163.com
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk add -U tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk add --no-cache bash bash-doc bash-completion \
&& apk del tzdata \
&& rm -rf /var/cache/apk/*
RUN mkdir -p /blade/desk
WORKDIR /blade/desk
@ -10,6 +19,6 @@ EXPOSE 8105
ADD ./target/blade-demo.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar app.jar
CMD ["--spring.profiles.active=test"]

18
blade-service/blade-demo/pom.xml

@ -57,6 +57,24 @@
<build>
<plugins>
<!--<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<name>${docker.image.prefix}/${project.artifactId}</name>
<alias>${project.artifactId}</alias>
<build>
<dockerFile>${project.basedir}\Dockerfile</dockerFile>
<tags>
<tag>${project.version}</tag>
</tags>
</build>
</image>
</images>
</configuration>
</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>

24
pom.xml

@ -37,6 +37,18 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springblade.platform</groupId>
<artifactId>blade-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
@ -58,18 +70,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springblade.platform</groupId>
<artifactId>blade-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Loading…
Cancel
Save