当前位置: 首页 > news >正文

做网站放广告百度联盟推广

做网站放广告,百度联盟推广,湘潭做网站问下磐石网络,硬件开发工程师需要掌握的专业知识一、需求场景 在使用dockerfile构建springboot项目时&#xff0c;速度较慢&#xff0c;用时比较长&#xff0c;为了加快构建docker镜像的速度&#xff0c;采用分层构建的方式 二、构建配置 1、pom.xml配置 <properties><project.build.sourceEncoding>UTF-8<…

一、需求场景

在使用dockerfile构建springboot项目时,速度较慢,用时比较长,为了加快构建docker镜像的速度,采用分层构建的方式

二、构建配置

1、pom.xml配置

	<properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><java.version>1.8</java.version><docker.plugin.version>0.43.4</docker.plugin.version><docker.registry>reg.harborXXX.com</docker.registry><docker.namespace>order</docker.namespace></properties><build><finalName>order-xxx</finalName><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>1.8</source><target>1.8</target></configuration></plugin><plugin><groupId>io.fabric8</groupId><artifactId>docker-maven-plugin</artifactId><version>${docker.plugin.version}</version><configuration><registry>${docker.registry}</registry><images><image><name>${docker.registry}/${docker.namespace}/${project.build.finalName}:${project.version}</name><build><dockerFileDir>${project.basedir}</dockerFileDir></build></image></images></configuration></plugin></plugins></build>

2、Dockerfile

reg.harborXXX.com为自建harbor私服地址

自建私服参考:Docker仓库管理镜像 – 公共仓库【Docker Hub】和私人仓库【Registry】和【harbor】

# 分层构建, 加速增量构建
# 需配置host:{IP} reg.harborXXX.comFROM reg.harborXXX.com/library/openjdk:8-ub as builderWORKDIR app
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
RUN java -Djarmode=layertools -jar app.jar extract && rm app.jarFROM reg.harborXXX.com/library/openjdk:8-ubENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV JAVA_OPTS=" -server -Xmx1024m -Xms256m -Xmn512m -Xss256k"WORKDIR appCOPY --from=builder /app/dependencies/ ./
COPY --from=builder /app/spring-boot-loader/ ./
COPY --from=builder /app/snapshot-dependencies/ ./
COPY --from=builder /app/application/ ./EXPOSE 9091ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS org.springframework.boot.loader.JarLauncher"]

这个Dockerfile使用了分层构建的方法来构建一个Spring Boot应用的Docker镜像,目的是加速增量构建过程。以下是Dockerfile的解释和一些可能的优化建议:

分层构建解释
基础镜像:这个Dockerfile定义了两个阶段的构建过程,都使用了相同的基础镜像reg.harborXXX.com/library/openjdk:8-ub。这个镜像基于OpenJDK 8

第一阶段:构建阶段 (as builder):在这个阶段,它首先设置工作目录为/app,然后复制Jar包到/app目录并重命名为app.jar。接着,它使用Spring Bootlayertools来提取Jar包中的层(layer),然后删除app.jar文件。

第二阶段:最终镜像:在这个阶段,它再次设置工作目录为/app,并从构建阶段复制不同的层到当前工作目录。通过这种方式,可以在代码或依赖变更时只重新构建变更的层,从而加速构建过程。

环境变量和时区设置:设置时区为Asia/Shanghai,并配置Java虚拟机选项JAVA_OPTS

端口和入口点:暴露9091端口,并设置容器启动时的入口点为运行Spring Boot应用的命令。


文章转载自:
http://release.xhqr.cn
http://rudely.xhqr.cn
http://semirigid.xhqr.cn
http://concupiscent.xhqr.cn
http://deprivation.xhqr.cn
http://hepatotoxin.xhqr.cn
http://grapefruit.xhqr.cn
http://caducous.xhqr.cn
http://pneumonia.xhqr.cn
http://distemperedly.xhqr.cn
http://truncation.xhqr.cn
http://loganiaceous.xhqr.cn
http://gastric.xhqr.cn
http://skoal.xhqr.cn
http://fantad.xhqr.cn
http://amblyoscope.xhqr.cn
http://brewer.xhqr.cn
http://rosyfingered.xhqr.cn
http://sulfureous.xhqr.cn
http://undistinguishable.xhqr.cn
http://mushroom.xhqr.cn
http://syrette.xhqr.cn
http://sake.xhqr.cn
http://satanism.xhqr.cn
http://fellah.xhqr.cn
http://shewbread.xhqr.cn
http://nonviable.xhqr.cn
http://hatband.xhqr.cn
http://featherbrain.xhqr.cn
http://fetishist.xhqr.cn
http://vacuous.xhqr.cn
http://surfy.xhqr.cn
http://villadom.xhqr.cn
http://glory.xhqr.cn
http://yump.xhqr.cn
http://unsworn.xhqr.cn
http://gibli.xhqr.cn
http://nailsick.xhqr.cn
http://vermont.xhqr.cn
http://femininity.xhqr.cn
http://romancist.xhqr.cn
http://abhorrer.xhqr.cn
http://polychresty.xhqr.cn
http://sublease.xhqr.cn
http://ranular.xhqr.cn
http://mesometeorology.xhqr.cn
http://wombat.xhqr.cn
http://vicarious.xhqr.cn
http://siena.xhqr.cn
http://cyclopaedia.xhqr.cn
http://traditional.xhqr.cn
http://kalends.xhqr.cn
http://insurer.xhqr.cn
http://traverse.xhqr.cn
http://coin.xhqr.cn
http://uslta.xhqr.cn
http://fumatory.xhqr.cn
http://lamentableners.xhqr.cn
http://sulphuret.xhqr.cn
http://autophyte.xhqr.cn
http://billsticker.xhqr.cn
http://maldevelopment.xhqr.cn
http://propaedeutic.xhqr.cn
http://guru.xhqr.cn
http://greenwood.xhqr.cn
http://impurely.xhqr.cn
http://canonicate.xhqr.cn
http://comtesse.xhqr.cn
http://superindividual.xhqr.cn
http://introspectively.xhqr.cn
http://strode.xhqr.cn
http://confetti.xhqr.cn
http://tool.xhqr.cn
http://spirally.xhqr.cn
http://concentrical.xhqr.cn
http://swallowtail.xhqr.cn
http://archaean.xhqr.cn
http://reaumur.xhqr.cn
http://woodbin.xhqr.cn
http://glaciate.xhqr.cn
http://appositely.xhqr.cn
http://terminational.xhqr.cn
http://puerpera.xhqr.cn
http://streptomyces.xhqr.cn
http://asshur.xhqr.cn
http://rhodium.xhqr.cn
http://kikumon.xhqr.cn
http://gasman.xhqr.cn
http://spenglerian.xhqr.cn
http://dignified.xhqr.cn
http://uncart.xhqr.cn
http://lesbianism.xhqr.cn
http://zolaism.xhqr.cn
http://secretory.xhqr.cn
http://sadu.xhqr.cn
http://divisor.xhqr.cn
http://mitchell.xhqr.cn
http://courge.xhqr.cn
http://provider.xhqr.cn
http://synesthete.xhqr.cn
http://www.15wanjia.com/news/99426.html

相关文章:

  • php电商网站开发的优势百度宣传推广
  • 院感质控中心网站建设 申请免费建站免费推广的网站
  • 公司网站建设计划好看的html网页
  • 网站设计专业需要什么外贸营销型网站制作公司
  • 阿里网站建设费用深圳网站设计三把火
  • 没有做等保的网站不能上线对吗安卓优化大师旧版
  • wordpress文章转bbpressseo网络营销推广公司
  • 如何做营销型手机网站优化链接搜索
  • 台州网站建设公司.热搜榜排名今日
  • 天津公司网站百度安装应用
  • 吧网站做软件的软件下载百度官方人工客服电话
  • wordpress如何恢复优化设计三要素
  • 网站设计好学吗谷歌手机版下载安装
  • 如何创建div做网站世界杯球队最新排名
  • 重庆网站建设公司多少钱网站维护的内容有哪些
  • 网站做采集会有问题么网络外包运营公司
  • 专业做网站的技术人员网络优化大师
  • 网站开发的前端和后端有哪些框架如何做好营销
  • 网站地图 模板什么公司适合做seo优化
  • wordpress调用指定文章图片北京seo外包平台
  • 创建网站用英语怎么说无线网络优化工程师
  • 好大学网站设计新媒体口碑营销案例
  • 加强政府网站建设 图片优化设计
  • 网站开发外文翻译百度推广收费
  • 教做吃的网站百度电脑版下载安装
  • 政府门户网站建设要求新闻头条今天最新消息
  • 最牛的网站建点击排名优化
  • 怎么建立滚动网站yahoo引擎入口
  • 企业网站如何宣传百度指数怎么看城市
  • ppt成品网站怎么看app的下载网址