- 构建docker镜像 cd 切换目录到Dockerfile目录,执行 docker build -t myappname .
- 编写Dockerfile
FROM openjdk:11
MAINTAINER test
ADD ./target/test-0.0.1-SNAPSHOT.jar /usr/target/test.jar
WORKDIR /usr/target
CMD ["java","-jar","test.jar"]
FROM openjdk:11
MAINTAINER test
ADD ./target/test-0.0.1-SNAPSHOT.jar /usr/target/test.jar
WORKDIR /usr/target
CMD ["java","-jar","test.jar"]
转载于:https://my.oschina.net/8808/blog/3060844