将SpringBoot应用Docker化并部署到SAP云平台
首先需要把SpringBoot应用打包成docker,我用的dockerfile内容为:
FROM openjdk:8-jdk-alpine
VOLUME /tmp
VOLUME /log
EXPOSE 8080
ADD target/prolikeService.jar app.jar
ENV JAVA_OPTS="-Dserver.port=8080"
ENTRYPOINT exec java $JAVA_OPTS -jar /app.jar
使用如下的命令行打包:
docker build -t i042416/springbootexample:v4 .
docker login登录docker hub,将该镜像上传:
docker push i042416/springbootexample:v4
最后使用命令部署到SAP Cloud Platform上:
cf push jerryjavadocker --docker-image i042416/springbootexample:v4
命令执行完毕后,能够在SAP云平台的控制台里,看到这个成功部署的Docker应用:
从控制台里得到应用url:
成功访问:
相关推荐
锋锋 2020-10-26
王道革 2020-11-25
bwyyziq 2020-11-22
pigsmall 2020-11-19
changecan 2020-11-19
helloWorldAndYou 2020-11-16
nginxs 2020-11-14
红石丶 2020-11-13
WanKaShing 2020-11-12
yangkang 2020-11-12
滴水穿石点石成金 2020-11-12
张荣珍 2020-11-12
wuxunanjing 2020-11-11
魅惑青花瓷 2020-11-11
lihongtai 2020-11-09
yangkang 2020-11-09
worldsnow 2020-11-06
MichaelJScofield 2020-11-06