修改pom.xml文件
<!-- 打包插件 -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.demo.HelloMailAppliation</mainClass>
<layout>ZIP</layout>
<!-- 注释后和依赖包一起打包 取消注释则不打包依赖-->
<includes>
<include>
<groupId>nothing</groupId>
<artifactId>nothing</artifactId>
</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Dockerfile
FROM bladex/alpine-java:openjdk8-openj9_cn_slim
MAINTAINER abc@abc.com
WORKDIR /app
COPY libs/ ./libs/
COPY ./new.jar ./app.jar
ENTRYPOINT ["java","-jar","-Djava.security.egd=file:/dev/./urandom","-Dloader.path=/app/libs","app.jar"]
CMD ["--spring.profiles.active-dev"]
常用命令:
查看所有的镜像镜像
docker images
查看所有的容器信息
docker ps -a
网友评论