<tfoot id='cbgjH'></tfoot>

      • <bdo id='cbgjH'></bdo><ul id='cbgjH'></ul>

    1. <legend id='cbgjH'><style id='cbgjH'><dir id='cbgjH'><q id='cbgjH'></q></dir></style></legend>

      <small id='cbgjH'></small><noframes id='cbgjH'>

    2. <i id='cbgjH'><tr id='cbgjH'><dt id='cbgjH'><q id='cbgjH'><span id='cbgjH'><b id='cbgjH'><form id='cbgjH'><ins id='cbgjH'></ins><ul id='cbgjH'></ul><sub id='cbgjH'></sub></form><legend id='cbgjH'></legend><bdo id='cbgjH'><pre id='cbgjH'><center id='cbgjH'></center></pre></bdo></b><th id='cbgjH'></th></span></q></dt></tr></i><div id='cbgjH'><tfoot id='cbgjH'></tfoot><dl id='cbgjH'><fieldset id='cbgjH'></fieldset></dl></div>

        如何使用配置文件在 docker 中启动 Spring Boot 应用程序?

        How can I start spring boot application in docker with profile?(如何使用配置文件在 docker 中启动 Spring Boot 应用程序?)

        <tfoot id='BGshC'></tfoot>
            <i id='BGshC'><tr id='BGshC'><dt id='BGshC'><q id='BGshC'><span id='BGshC'><b id='BGshC'><form id='BGshC'><ins id='BGshC'></ins><ul id='BGshC'></ul><sub id='BGshC'></sub></form><legend id='BGshC'></legend><bdo id='BGshC'><pre id='BGshC'><center id='BGshC'></center></pre></bdo></b><th id='BGshC'></th></span></q></dt></tr></i><div id='BGshC'><tfoot id='BGshC'></tfoot><dl id='BGshC'><fieldset id='BGshC'></fieldset></dl></div>
          1. <legend id='BGshC'><style id='BGshC'><dir id='BGshC'><q id='BGshC'></q></dir></style></legend>
            • <bdo id='BGshC'></bdo><ul id='BGshC'></ul>
                <tbody id='BGshC'></tbody>

                  <small id='BGshC'></small><noframes id='BGshC'>

                  本文介绍了如何使用配置文件在 docker 中启动 Spring Boot 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个简单的 spring-boot 项目:

                  I have a simple spring-boot project:

                  -resources
                   -application.yaml
                   -application-test.yaml
                  

                  我有这个 Dockerfile:

                  FROM openjdk:8-jdk-alpine
                  EXPOSE 8080
                  ADD micro-boot.jar micro-boot.jar
                  ENTRYPOINT ["java","-Dspring.profiles.active=test" "-jar","/micro-boot.jar"]
                  

                  1) 我构建镜像 - C:micro-boot>docker build -f Dockerfile -t micro-boot .

                  1) I build image - C:micro-boot>docker build -f Dockerfile -t micro-boot .

                  2) 显示所有镜像 - C:micro-boot>docker image ls -a

                  2) show all images - C:micro-boot>docker image ls -a

                  micro-boot   latest  ccc9a75ebc24  4 seconds ago 112MB
                  

                  3) 尝试启动C:micro-boot>docker image ls -a

                  我得到一个错误:

                  /bin/sh: [java,-Dspring.profiles.active=test: not found
                  

                  推荐答案

                  这里有错别字

                  ENTRYPOINT ["java","-Dspring.profiles.active=test" 此处缺少逗号 "-jar","/micro-boot.jar"]

                  这篇关于如何使用配置文件在 docker 中启动 Spring Boot 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

                  • <small id='zR7bG'></small><noframes id='zR7bG'>

                      <legend id='zR7bG'><style id='zR7bG'><dir id='zR7bG'><q id='zR7bG'></q></dir></style></legend>
                      <i id='zR7bG'><tr id='zR7bG'><dt id='zR7bG'><q id='zR7bG'><span id='zR7bG'><b id='zR7bG'><form id='zR7bG'><ins id='zR7bG'></ins><ul id='zR7bG'></ul><sub id='zR7bG'></sub></form><legend id='zR7bG'></legend><bdo id='zR7bG'><pre id='zR7bG'><center id='zR7bG'></center></pre></bdo></b><th id='zR7bG'></th></span></q></dt></tr></i><div id='zR7bG'><tfoot id='zR7bG'></tfoot><dl id='zR7bG'><fieldset id='zR7bG'></fieldset></dl></div>

                        • <bdo id='zR7bG'></bdo><ul id='zR7bG'></ul>

                            <tbody id='zR7bG'></tbody>

                            <tfoot id='zR7bG'></tfoot>