FROM java:8
MAINTAINER dujunhui
#将jar包添加到容器内并更名
ADD /jar/myTest-0.0.1-SNAPSHOT.jar app.jar
CMD java -jar app.jar
docker build -f ./springboot_dockerfile -t app .
docker build -f ./springboot_dockerfile -t test_app:1.0 .
FROM openjdk:8
EXPOSE 5789
MAINTAINER dujunhui
CMD java -jar ruoyi-admin.jar
创建镜像
docker build -f /home/myjar/DockerFile -t app .
创建容器
docker run \
-p 5789:5789 \
-v /home/myjar/ruoyi-admin.jar:/ruoyi-admin.jar \
--name rb_app \
--restart=always \
-d app