久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='6jVUz'></small><noframes id='6jVUz'>

    <i id='6jVUz'><tr id='6jVUz'><dt id='6jVUz'><q id='6jVUz'><span id='6jVUz'><b id='6jVUz'><form id='6jVUz'><ins id='6jVUz'></ins><ul id='6jVUz'></ul><sub id='6jVUz'></sub></form><legend id='6jVUz'></legend><bdo id='6jVUz'><pre id='6jVUz'><center id='6jVUz'></center></pre></bdo></b><th id='6jVUz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6jVUz'><tfoot id='6jVUz'></tfoot><dl id='6jVUz'><fieldset id='6jVUz'></fieldset></dl></div>

    <tfoot id='6jVUz'></tfoot>

        <bdo id='6jVUz'></bdo><ul id='6jVUz'></ul>
      <legend id='6jVUz'><style id='6jVUz'><dir id='6jVUz'><q id='6jVUz'></q></dir></style></legend>
      1. 在 docker 鏡像中部署 WAR 文件的正確方法

        Correct way to deploy WAR files in docker image(在 docker 鏡像中部署 WAR 文件的正確方法)

          <legend id='UWbIO'><style id='UWbIO'><dir id='UWbIO'><q id='UWbIO'></q></dir></style></legend>
          <i id='UWbIO'><tr id='UWbIO'><dt id='UWbIO'><q id='UWbIO'><span id='UWbIO'><b id='UWbIO'><form id='UWbIO'><ins id='UWbIO'></ins><ul id='UWbIO'></ul><sub id='UWbIO'></sub></form><legend id='UWbIO'></legend><bdo id='UWbIO'><pre id='UWbIO'><center id='UWbIO'></center></pre></bdo></b><th id='UWbIO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UWbIO'><tfoot id='UWbIO'></tfoot><dl id='UWbIO'><fieldset id='UWbIO'></fieldset></dl></div>
            <tbody id='UWbIO'></tbody>
            <bdo id='UWbIO'></bdo><ul id='UWbIO'></ul>
            <tfoot id='UWbIO'></tfoot>
                • <small id='UWbIO'></small><noframes id='UWbIO'>

                • 本文介紹了在 docker 鏡像中部署 WAR 文件的正確方法的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  在docker容器中部署java項目的docker方式是什么?

                  What is the docker way to deploy java projects in a docker container?

                  我是否將戰爭復制到 webapps 中:

                  Do I copy the war into webapps:

                  FROM jetty:9.2.10
                  MAINTAINER Me "me@me.com"
                  ADD ./target/*.war /var/lib/jetty/webapps/ROOT.war
                  

                  還是我拿爆炸的戰爭文件:

                  or do I take the exploded war file:

                  FROM jetty:9.2.10
                  MAINTAINER Me "me@me.com"
                  ADD ./target/app-0.1.0.BUILD-SNAPSHOT /var/lib/jetty/webapps/ROOT
                  

                  如果它是一個普通容器,通常會部署密封的戰爭文件,但對于 docker,這意味著每次你做一個小的改變時都會推送一個 10-20MB 的文件,而添加爆炸的戰爭只會推動差異 - .已更改的類文件.

                  Normally one would deploy the sealed war file if it was a normal container, but with docker, that means pushing a 10-20MB file every time you make a small change whereas adding the exploded war would only push the difference - the .class file that has changed.

                  部署爆炸戰爭而不是戰爭文件有什么缺點嗎?

                  Are there any downsides to deploying the exploded war instead of the war file?

                  推薦答案

                  我想知道您是如何使用圖像的.在構建圖像時添加 20MB 文件幾乎應該是即時的.也許你在部署過程中以某種方式構建圖像,就像 AWS 在你給它一個 Dockerfile 時所做的那樣.

                  I wonder how you're using your images. Adding a 20MB file while building an image should almost be instant. Mayb you somehow building images during deployment, like AWS does when you give it a Dockerfile.

                  無論如何,我認為這取決于您的部署方式.如果您在自己周圍移動圖像,我認為添加 .war 文件和分解的 WAR 目錄之間沒有太大區別.我會說做你方便的事.但是,如果您有時從 Docker 運行應用程序,有時從 .war 運行應用程序(這可能會忽略 Docker 的某些要點),那么您不妨一直使用 .war.

                  In any case, I think it depends on how you're deploying. If you're moving the images around yourself, I don't see a lot of difference between ADDing a .war file and an exploded WAR directory. I would say do what's convenient for you. However, if you sometimes run the app from Docker and sometimes from a .war (which might miss some of the point of Docker), you might as well use the .war all the time.

                  如果您要部署到諸如 AWS Elastic Beanstalk(從存儲庫中提取圖像的東西)之類的東西,它需要 Dockerfile 或 Dockerrun.aws.json 文件,那么將圖像與您實際部署的內容分開會產生一些影響有意義(或者到目前為止對我來說是有意義的).這允許容器保持不變,而更新您的應用程序只需將 .jar/.war 文件復制到正確的位置(這也可能會錯過 Docker 的部分要點;).

                  If you're deploying to something like AWS Elastic Beanstalk (something that pulls the image from a repository), which wants either a Dockerfile or a Dockerrun.aws.json file, then separating the image from what you actually deploy makes some sense (or it has made sense to me so far). This allows the container to stay the same, while updating your app can be just copying a .jar/.war file to the right location (which also might miss part of the point of Docker ;).

                  我一直在做的是在 Docker Hub 上創建一個基礎映像,然后使用 Dockerrun.aws.json 文件在我的應用程序中進行映射.這樣,AWS 不需要構建我的鏡像,只需拉取它.這更快,成本更低($).但它確實將我的應用程序與圖像分開,這在某些情況下可能會使部署復雜化.但是,因為我的鏡像非常穩定,所以我通常只是將一個 .jar 文件、一個 Dockerrun.aws.json 文件和一個 shell 腳本打包成一個 .zip 并上傳到 AWS.我覺得很簡單.

                  What I've been doing is creating a base image on Docker Hub and then using the Dockerrun.aws.json file to map in my app. That way, AWS does not need to build my image, just pull it. That's much faster and less costly ($). But it does separate my app from the image, which might complicate deployment in some circumstances. However, because my image is so stable, I generally just bundle a .jar file, a Dockerrun.aws.json file and a shell script into a .zip and upload it to AWS. Pretty easy I think.

                  我的 Dockerfile 非常簡單,是我的 Spring Boot 應用程序所需要的全部內容:

                  My Dockerfile is pretty simple and really all I need for my Spring Boot app:

                  FROM java:8
                  VOLUME /tmp
                  VOLUME /app
                  EXPOSE 8080
                  ENTRYPOINT ["sh","/app/app.sh"]
                  

                  您可以執行類似的操作并使用 -v 選項等將卷映射到您的應用程序、環境設置等.順便說一句,這個鏡像 在 Docker Hub 上可用.

                  You could do something similar and use the -v option, etc., to map volumes to your app, it's environment settings, etc. BTW, this image is available on Docker Hub.

                  這篇關于在 docker 鏡像中部署 WAR 文件的正確方法的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                    <bdo id='4uzXn'></bdo><ul id='4uzXn'></ul>
                      <tbody id='4uzXn'></tbody>

                    <tfoot id='4uzXn'></tfoot>
                      <i id='4uzXn'><tr id='4uzXn'><dt id='4uzXn'><q id='4uzXn'><span id='4uzXn'><b id='4uzXn'><form id='4uzXn'><ins id='4uzXn'></ins><ul id='4uzXn'></ul><sub id='4uzXn'></sub></form><legend id='4uzXn'></legend><bdo id='4uzXn'><pre id='4uzXn'><center id='4uzXn'></center></pre></bdo></b><th id='4uzXn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4uzXn'><tfoot id='4uzXn'></tfoot><dl id='4uzXn'><fieldset id='4uzXn'></fieldset></dl></div>

                        <small id='4uzXn'></small><noframes id='4uzXn'>

                          <legend id='4uzXn'><style id='4uzXn'><dir id='4uzXn'><q id='4uzXn'></q></dir></style></legend>

                          1. 主站蜘蛛池模板: 婷婷色国产偷v国产偷v小说 | av在线一区二区 | 天堂av中文在线 | 欧美精品在线免费 | 一区免费观看 | 国产精品久久久久久久久久久免费看 | 国产麻豆一区二区三区 | 黄色av网站在线观看 | 国产成人精品综合 | 黄色亚洲网站 | 国产精品久久久久久久久久久久冷 | 综合久久99 | 欧美一区免费在线观看 | 在线婷婷 | 久久久久资源 | 欧美成人精品一区二区三区 | 国产高清视频一区二区 | 成人av网站在线观看 | 日韩成人精品一区二区三区 | 亚洲三级av | 日韩欧美国产精品 | 成人动慢 | 亚洲国产成人久久综合一区,久久久国产99 | 国产精品综合视频 | 久久久久亚洲 | 久久精品国产亚洲一区二区三区 | 国产99视频精品免费视频7 | 欧美一区二区在线播放 | 久久久久久久国产精品影院 | 亚洲国产福利视频 | 久在线 | 二区在线视频 | 日韩av啪啪网站大全免费观看 | 欧美日韩免费一区二区三区 | 两性午夜视频 | 成人毛片在线观看 | 国产一区二区在线看 | 国产精品成人一区二区三区夜夜夜 | 欧美在线一区二区三区 | 国产精品视频偷伦精品视频 | 超黄视频网站 |