如何创建一份springboot的docker镜像

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

FROM centos:7

 

ENV JAVA_HOME /usr/java/jdk1.7.0_55

ENV MAC_PUBLISH_PATH /home/app

 

ENV LOG_PATH /var/log

 

ENV PATH $JAVA_HOME/bin:$PATH

ENV  TIME_ZONE Asia/Shanghai

COPY jdk-7u55-linux-x64.rpm /opt/

 

RUN mkdir -p $MAC_PUBLISH_PATH && mkdir -p "$LOG_PATH" && rpm -ih /opt/jdk-7u55-linux-x64.rpm \

&& rm -rf /opt/jdk-7u55-linux-x64.rpm

 

COPY spring-boot-xxx-ap一p-0.0.1-SNAPSHOT.jar $MAC_PUBLISH_PATH

 

COPY config $MAC_PUBLISH_PATH/config

 

WORKDIR $MAC_PUBLISH_PATH

 

RUN set -xe \

&& chown -R 1000:1000 "$MAC_PUBLISH_PATH" \
&& chown -R 1000:1000 "$LOG_PATH" \
&& echo "${TIME_ZONE}" > /etc/timezone \
&& ln -sf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime

 

EXPOSE 8090

 

VOLUME $LOG_PATH

VOLUME /$MAC_PUBLISH_PATH/config

ENV LANG en_US.UTF-8

CMD ["java","-jar","/home/app/spring-boot-xxx-app-0.0.1-SNAPSHOT.jar"]

以上是Dockerfile一个很好的模板,所有资源文件必须跟Dockerfile在同一文件夹。最后输入命令docker build -t 镜像标签 路径

转载于:https://my.oschina.net/u/3768341/blog/1612709

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278543.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Xamarin.Android 开发中遇到旋转屏幕错误

错误信息 : System.NotSupportedException: Unable to find the default constructor on type App5.MyFragment. Please provide the missing constructor. 错误图片: 解决方法:干脆不让他旋转屏幕,当下QQ、微信等app都没有旋转等功能&#…

windows7黑屏修复_如何在Windows 10更新后修复黑屏

windows7黑屏修复RealVector/Shutterstock.comRealVector / Shutterstock.comSome Windows 10 PCs have been rebooting to a black screen after installing the June 2019 cumulative update from Windows Update. This seems scary at first, but luckily there’s a quick …

vue/cli4 创建vue项目选项详解

多版本创建项目一、vue-cli2.x二、vue-cli3.x三、vue-cli4.x1.查看 vue 版本: 项目中,找到package.json文件夹 找"dependencies"中的vue ; 若无项目,在cmd中输入 where vue,cd到vue目录下输入 npm list vue &#xff0c…

rainmeter使用教程_如何使用Rainmeter在桌面上显示报价

rainmeter使用教程I’ve never really been a desktop gadgets and widgets type of person, but I often put an inspirational quote on my desktop wallpaper. Today we’ll show you how to do this using Rainmeter, no matter what wallpaper you switch to. 我从来没有真…

Some code changes cannot be hot swapped into a running virtual machine

java运行中修改代码不能改变立刻应用到本次运行中转载于:https://www.cnblogs.com/Pusteblume/p/10211110.html

JMeter扩展JMeter插件获取更多监听器

为了获取更多监听器,方便的监控系统及应用,有必要安装第三方插件 插件下载地址: https://jmeter-plugins.org/downloads/old/ http://pan.baidu.com/s/1gfC11yN 注:如果插件和软件版本不兼容,可能在开启Jmeter时会报错…

如何阻止Chrome(或Edge)接管媒体密钥

Google Chrome now has built-in support for media keys. Unfortunately, Chrome will take over your media keys and prevent them from controlling apps like Spotify when you’re watching YouTube, for example. Here’s how to make Chrome ignore your media keys. G…

开源性能测试工具JMeter快速入门(一)

目录一、JMeter简介二、JMeter功能介绍三、JMeter脚本四、关于JMeter小提示一、JMeter简介1.定义JMeter是Apache组织开发的基于Java的压力测试工具。用于对软件做压力测试,它最初被设计用于Web应用测试,但后来扩展到其他测试领域。 1)它可以用…

八重州8900如何解锁_八重贵族怪胎之路

八重州8900如何解锁Dealing with computers day in and day out can be a harrowing experience. In difficult times, or even when things are idle, finding some spirituality can help cope with the experience—Techies: I give you the Eightfold Noble Geek Path. 日…

赠与大学毕业生_出售,赠与或交易iPhone之前应该做什么

赠与大学毕业生A factory reset of your iPhone erases all of your content and settings, reverting it to a like-new state. However, there are a few extra steps you should take if you plan to get rid of your iPhone. iPhone的恢复出厂设置将删除所有内容和设置&…

powerpoint预览_如何放大和缩小PowerPoint演示文稿的一部分

powerpoint预览Microsoft PowerPoint lets you zoom in and out on a specific part of your PowerPoint slideshow, which can be handy both while editing and for drawing attention to important objects or ideas during the presentation. Here’s how to do it. Micros…

从Firefox控制您喜欢的音乐播放器

Do you love listening to music while you browse? Now you can access and control your favorite music player directly from Firefox with the FoxyTunes extension. 您喜欢在浏览时听音乐吗? 现在,您可以直接使用FoxyTunes扩展程序从Firefox访问和…

ms project 入门_Microsoft Project 2010入门

ms project 入门Would you like to keep your projects on track and keep track of how time and resources are used? Let’s take a look at Microsoft Project 2010 and how it can help you stay on top of your projects. 您想保持项目进度并了解如何使用时间和资源吗&…

mysql基本的增删改查和条件语句

增 insert into 表名(列名,列名。。。。。。) values("test1",23),("test2",23),("test3",24); 这条命令可以一次增加一条数据,也可以同时增加多条数据 还可以从插入其他的表到数据到当前表 insert into 插入的…

黑莓os软件下载_在PC上试用BlackBerry OS

黑莓os软件下载There’s a wider selection of smart phones and mobile OS’s than ever before, but you can’t just go buy every phone available and try them all out. Here’s how you can test out the latest version of the BlackBerry OS for free on your PC. 智…

Spring事务管理(三)-PlatformmTransactionManager解析和事务传播方式原理

2019独角兽企业重金招聘Python工程师标准>>> Spring在事务管理时,对事务的处理做了极致的抽象,即PlatformTransactionManager。对事务的操作,简单地来说,只有三步操作:获取事务,提交事务&#x…

div方框弯曲边样式_使用弯曲样式编辑文本

div方框弯曲边样式Would you like a new Notepad replacement that incorporates the latest technologies while staying slim and fast? Text editors are usually bland, boring programs, but here’s a new one that makes your text come to life beautifully. 您是否想…

分布式锁的几种实现原理

分布式锁主流有三种模式: 实现方式 功能要求 实现难度 学习成本 运维成本 MySQL 的方案借助表锁/行锁实现 满足基本要求 不难 熟悉 小量OK、大量影响现有业务、1主多从架构,不方便扩容 通过 ZK 创建数据节点的方式实现 满足要求 熟悉 ZK API 即可 需要学…

如何破解您忘记的Windows密码

Here at How-To Geek, we’ve covered many different ways to reset your password for Windows—but what if you can’t reset your password? Or what if you’re using drive encryption that would wipe out your files if you changed the password? It’s time to cr…

sql语句练习50题(Mysql版)

表名和字段–1.学生表Student(s_id,s_name,s_birth,s_sex) –学生编号,学生姓名, 出生年月,学生性别–2.课程表Course(c_id,c_name,t_id) – –课程编号, 课程名称, 教师编号–3.教师表Teacher(t_id,t_name) –教师编号,教师姓名–4.成绩表Score(s_id,c_id,s_score) –学生编号…