{"id":64952,"date":"2023-08-10T12:01:00","date_gmt":"2023-08-10T12:01:00","guid":{"rendered":"https:\/\/www.azul.com\/?p=64952"},"modified":"2023-09-28T20:24:57","modified_gmt":"2023-09-28T20:24:57","slug":"configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options","status":"publish","type":"post","link":"https:\/\/www.azul.com\/zh-hans\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/","title":{"rendered":"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf"},"content":{"rendered":"\n<p><em>\u501f\u52a9 Spring Boot Maven \u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u4ece\u5e94\u7528\u7a0b\u5e8f\u4e2d\u8f7b\u677e\u521b\u5efa Docker \u6620\u50cf\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u914d\u7f6e Spring Boot \u7684\u66f4\u591a\u6280\u5de7\u548c\u793a\u4f8b\uff0c\u4ee5\u5b9a\u4e49\u6b64\u7c7b Spring Boot Docker \u6620\u50cf\u4e2d\u4f7f\u7528\u7684 Java \u8fd0\u884c\u65f6\uff0c\u5e76\u89e3\u91ca\u5982\u4f55\u6dfb\u52a0\u5176\u4ed6\u73af\u5883\u9009\u9879\u6765\u7b80\u5316\u8c03\u8bd5\u3002<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-\u672c\u6587\u7684\u64b0\u5199\u5f97\u5230-spring-\u5f00\u53d1\u6280\u672f\u63a8\u5e7f\u5de5\u7a0b\u5e08-nbsp-dashaun-carter-\u7684\u6089\u5fc3\u5e2e\u52a9-\u4ed6\u5728\u6211\u63d0\u51fa\u6709\u5173\u8fd9\u4e9b\u914d\u7f6e\u9009\u9879\u7684\u95ee\u9898\u65f6\u7acb\u5373\u7ed9\u4e88\u89e3\u7b54-\u5728\u6b64\u5411-dashaun-\u8868\u793a\u611f\u8c22\">\u672c\u6587\u7684\u64b0\u5199\u5f97\u5230 Spring \u5f00\u53d1\u6280\u672f\u63a8\u5e7f\u5de5\u7a0b\u5e08&nbsp;<a href=\"https:\/\/twitter.com\/dashaun\" target=\"_blank\" rel=\"noreferrer noopener\">DaShaun Carter<\/a> \u7684\u6089\u5fc3\u5e2e\u52a9\uff0c\u4ed6\u5728\u6211\u63d0\u51fa\u6709\u5173\u8fd9\u4e9b\u914d\u7f6e\u9009\u9879\u7684\u95ee\u9898\u65f6\u7acb\u5373\u7ed9\u4e88\u89e3\u7b54\u3002\u5728\u6b64\u5411 DaShaun \u8868\u793a\u611f\u8c22\uff01<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-spring-boot-petclinic-\u9879\u76ee\">Spring Boot Petclinic \u9879\u76ee<\/h2>\n\n\n\n<p>\u4e3a\u4e86\u8bf4\u660e\u6211\u4eec\u7684\u65b9\u6cd5\uff0c\u6587\u4e2d\u5c06\u8fd0\u7528 Spring Boot Petclinic \u9879\u76ee\uff08\u4e00\u6b3e\u5229\u7528 Maven \u6216 Gradle \u6784\u5efa\u7684 Spring Boot \u5e94\u7528\u7a0b\u5e8f\uff09\u6765\u6f14\u793a\u5982\u4f55\u5168\u9762\u8bbe\u7f6e Spring Boot \u9879\u76ee\uff0c\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u7ed3\u6784\u5316\u5e76\u6267\u884c\u5fc5\u8981\u7684\u5c01\u88c5\u3002<\/p>\n\n\n\n<p>\u60a8\u53ef\u4ece GitHub \u83b7\u53d6\u5b8c\u6574\u9879\u76ee\uff0c\u5305\u62ec\u9488\u5bf9\u5404\u79cd\u7528\u4f8b\u7684\u4e30\u5bcc\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$ git clone https:\/\/github.com\/spring-projects\/spring-petclinic\n$ cd spring-petclinic<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\u4fee\u6539\u548c\u6269\u5c55\u9ed8\u8ba4\u8bbe\u7f6e\">\u4fee\u6539\u548c\u6269\u5c55\u9ed8\u8ba4\u8bbe\u7f6e<\/h2>\n\n\n\n<p>\u6211\u4eec\u53ea\u9700\u5728\u9879\u76ee\u7684&nbsp;pom.xml&nbsp;\u6587\u4ef6\u4e2d\u7684&nbsp;spring-boot-maven-plugin&nbsp;\u90e8\u5206\u7a0d\u7a0d\u8fdb\u884c\u989d\u5916\u914d\u7f6e\uff0c\u5373\u53ef\u4fee\u6539\u6240\u751f\u6210 Docker \u6620\u50cf\u4e2d\u7684 OpenJDK \u53d1\u884c\u7248\u3002\u8bf7\u52ff\u66f4\u6539\u6267\u884c\u8fc7\u7a0b\uff0c\u4ec5\u63d2\u5165\u914d\u7f6e\u90e8\u5206\u5373\u53ef\u3002\u6b64 Docker \u6620\u50cf\u7684\u76ee\u6807\u662f\u7eb3\u5165\u6240\u6709\u53ef\u80fd\u4f7f\u7528\u7684\u8c03\u8bd5\u548c\u6d4b\u8bd5\u5de5\u5177\uff0c\u56e0\u6b64\u5305\u542b\u4ee5\u4e0b\u6240\u6709\u9009\u9879\u3002\u5f53\u7136\uff0c\u4f7f\u7528\u54ea\u4e9b\u5de5\u5177\u53d6\u51b3\u4e8e\u60a8\u7684\u7528\u4f8b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>    &lt;plugin&gt;\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\n        &lt;configuration&gt;\n            &lt;image&gt;\n                &lt;buildpacks&gt;\n                    &lt;buildpack&gt;paketobuildpacks\/azul-zulu&lt;\/buildpack&gt;\n                    &lt;buildpack&gt;paketobuildpacks\/java&lt;\/buildpack&gt;\n                &lt;\/buildpacks&gt;\n                \n                &lt;env&gt;\n                    &lt;BP_JVM_VERSION&gt;17&lt;\/BP_JVM_VERSION&gt;\n                    &lt;BP_JVM_TYPE&gt;JDK&lt;\/BP_JVM_TYPE&gt;\n\n                    &lt;BPE_DELIM_JAVA_TOOL_OPTIONS xml:space=\"preserve\"&gt; &lt;\/BPE_DELIM_JAVA_TOOL_OPTIONS&gt;\n                    &lt;BPE_APPEND_JAVA_TOOL_OPTIONS&gt;-Xlog:gc:\/tmp\/gc.log&lt;\/BPE_APPEND_JAVA_TOOL_OPTIONS&gt;\n\n                    &lt;BPE_DEFAULT_BPL_DEBUG_ENABLED&gt;true&lt;\/BPL_DEBUG_ENABLED&gt;\n                    &lt;BPE_DEFAULT_BPL_DEBUG_PORT&gt;8000&lt;\/BPL_DEBUG_PORT&gt; &lt;!-- This is the default value --&gt;\n                    &lt;BPE_DEFAULT_BPL_JMX_ENABLED&gt;true&lt;\/BPL_JMX_ENABLED&gt;\n                    &lt;BPE_DEFAULT_BPL_JMX_PORT&gt;5000&lt;\/BPL_JMX_PORT&gt; &lt;!-- This is the default value --&gt;\n                    &lt;BPE_DEFAULT_BPL_JAVA_NMT_ENABLED&gt;true&lt;\/BPL_JAVA_NMT_ENABLED&gt; &lt;!-- This is the default value --&gt;\n                    &lt;BPE_DEFAULT_BPL_JFR_ENABLED&gt;true&lt;\/BPL_JFR_ENABLED&gt; \n                    &lt;BPE_DEFAULT_BPL_JFR_ARGS&gt;dumponexit=true,filename=\/tmp\/rec.jfr,duration=600s&lt;\/BPL_JFR_ARGS&gt;\n                &lt;\/env&gt;\n            &lt;\/image&gt;\n        &lt;\/configuration&gt;\n        &lt;executions&gt;\n            ...\n        &lt;\/executions&gt;\n    &lt;\/plugin&gt;<\/code><\/pre>\n\n\n\n<p>\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3\u8fd9\u4e00\u90e8\u5206\uff0c\u6211\u4eec\u5206\u522b\u6765\u770b\u770b\u6240\u6709\u4e0d\u540c\u9009\u9879\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><buildpacks>&nbsp;\u90e8\u5206\u5b9a\u4e49\u4e86\u54ea\u4e9b\u6784\u5efa\u5305\u7528\u4e8e\u751f\u6210 Docker \u6620\u50cf\u3002<\/buildpacks>\n<ul class=\"wp-block-list\">\n<li>\u53ef\u5728&nbsp;<a href=\"https:\/\/github.com\/paketo-buildpacks\/azul-zulu\" target=\"_blank\" rel=\"noreferrer noopener\">github.com\/paketo-buildpacks\/azul-zulu<\/a>&nbsp;\u67e5\u770b\u53ef\u7528\u914d\u7f6e\u5217\u8868\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><env>&nbsp;\u90e8\u5206\u5bf9\u6240\u6709\u4e0e\u73af\u5883\u76f8\u5173\u7684\u66f4\u6539\u8fdb\u884c\u5206\u7ec4\uff0c\u5e76\u5728&nbsp;<a href=\"https:\/\/paketo.io\/docs\/howto\/configuration\/#environment-variables\" target=\"_blank\" rel=\"noreferrer noopener\">Paketo Docs &gt; How To Configure Paketo Buildpacks &gt; Environment Variables<\/a> \u4e2d\u63cf\u8ff0\u4e86\u4e0d\u540c\u7684\u76ee\u6807\u3002<\/env>\n<ul class=\"wp-block-list\">\n<li><strong>BP_<\/strong>\uff1a\u7528\u4e8e\u914d\u7f6e\u6784\u5efa\u8fc7\u7a0b\u672c\u8eab\u7684\u53d8\u91cf\uff0c\u4f8b\u5982\u8bbe\u7f6e Java \u7248\u672c\u3002<\/li>\n\n\n\n<li><strong>BPE_<\/strong>\uff1a\u6620\u50cf\u5d4c\u5165\u5f0f\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>BPL_<\/strong>\uff1a\u5e94\u7528\u7a0b\u5e8f\u6620\u50cf\u7684\u8fd0\u884c\u65f6\u7279\u6027\uff0c\u5728\u5e94\u7528\u7a0b\u5e8f\u5bb9\u5668\u4e2d\u88ab\u8bbe\u7f6e\u4e3a\u73af\u5883\u53d8\u91cf\u3002\u5fc5\u987b\u4e3a\u8fd9\u4e9b\u7279\u6027\u9644\u52a0&nbsp;BPE_DEFAULT_\uff0c\u624d\u53ef\u5c06\u5176\u901a\u8fc7\u201cbake\u201d\u547d\u4ee4\u6784\u5efa\u81f3\u5bb9\u5668\u6620\u50cf\u4ee5\u4f9b\u81ea\u52a8\u4f7f\u7528<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-\u6784\u5efa-docker-\u6620\u50cf\">\u6784\u5efa Docker \u6620\u50cf<\/h3>\n\n\n\n<p>\u6b64\u5904\u7684\u6784\u5efa Docker \u6620\u50cf\u64cd\u4f5c\u91c7\u7528\u5355\u884c\u547d\u4ee4\uff0c\u8f93\u51fa\u5c06\u663e\u793a\u5bf9 Azul JDK \u7684\u4e00\u4e9b\u5f15\u7528\u4ee5\u53ca\u6211\u4eec\u5728\u4e0d\u540c\u6d4b\u8bd5\u5468\u671f\u4e4b\u540e\u7684\u8bbe\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$ .\/mvnw spring-boot:build-image\n\n[INFO] Scanning for projects...\n[INFO] \n[INFO] ------------&lt; org.springframework.samples:spring-petclinic &gt;------------\n[INFO] Building petclinic 3.1.0-SNAPSHOT\n[INFO]   from pom.xml\n[INFO] --------------------------------[ jar ]---------------------------------\n[INFO] \n\n...\n\n[INFO] --- spring-boot:3.1.1:build-image (default-cli) @ spring-petclinic ---\n[INFO] Building image 'docker.io\/library\/spring-petclinic:3.1.0-SNAPSHOT'\n[INFO] \n[INFO]  &gt; Pulling builder image 'docker.io\/paketobuildpacks\/builder:base' 100%\n\n...\n\n[INFO]  &gt; Pulling buildpack image 'docker.io\/paketobuildpacks\/azul-zulu:latest' 100%\n[INFO]  &gt; Pulled buildpack image 'paketobuildpacks\/azul-zulu@sha256:79419af00c95f85c088e68808f61b2486c39a7e12a0033995970c97e95408069'\n\n...\n\n[INFO]  &gt; Running creator\n[INFO]     [creator]     ===&gt; ANALYZING\n[INFO]     [creator]     Image with name \"docker.io\/library\/spring-petclinic:3.1.0-SNAPSHOT\" not found\n[INFO]     [creator]     ===&gt; DETECTING\n[INFO]     [creator]     8 of 27 buildpacks participating\n[INFO]     [creator]     paketo-buildpacks\/azul-zulu             10.1.5\n\n...\n\n[INFO]     [creator]     ===&gt; BUILDING\n[INFO]     [creator]     \n[INFO]     [creator]     Paketo Buildpack for Azul Zulu 10.1.5\n[INFO]     [creator]       https:\/\/github.com\/paketo-buildpacks\/azul-zulu\n[INFO]     [creator]       Build Configuration:\n[INFO]     [creator]         $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)\n[INFO]     [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE\n[INFO]     [creator]         $BP_JVM_TYPE                 JDK                                                          the JVM type - JDK or JRE\n[INFO]     [creator]         $BP_JVM_VERSION              17                                                           the Java version\n[INFO]     [creator]       Launch Configuration:\n[INFO]     [creator]         $BPL_DEBUG_ENABLED           true                                                         enables Java remote debugging support\n[INFO]     [creator]         $BPL_DEBUG_PORT              8000                                                         configure the remote debugging port\n[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false                                                        configure whether to suspend execution until a debugger has attached\n[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                                                                       write heap dumps on error to this path\n[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        true                                                         enables Java Native Memory Tracking (NMT)\n[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary                                                      configure level of NMT, summary or detail\n[INFO]     [creator]         $BPL_JFR_ARGS                dumponexit=true,filename=\/tmp\/rec.jfr,duration=600s          configure custom Java Flight Recording (JFR) arguments\n[INFO]     [creator]         $BPL_JFR_ENABLED             true                                                         enables Java Flight Recording (JFR)\n[INFO]     [creator]         $BPL_JMX_ENABLED             true                                                         enables Java Management Extensions (JMX)\n[INFO]     [creator]         $BPL_JMX_PORT                5000                                                         configure the JMX port\n[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0                                                            the headroom in memory calculation\n[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes                                               the number of loaded classes in memory calculation\n[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250                                                          the number of threads in memory calculation\n[INFO]     [creator]         $JAVA_TOOL_OPTIONS                                                                        the JVM launch flags\n[INFO]     [creator]         Using Java version 17 from BP_JVM_VERSION\n[INFO]     [creator]       A JDK was specifically requested by the user, however a JRE is available. Using a JDK at runtime has security implications.\n[INFO]     [creator]       Azul Zulu JDK 17.0.7: Contributing to layer\n\n...\n\n[INFO] Successfully built image 'docker.io\/library\/spring-petclinic:3.1.0-SNAPSHOT'\n[INFO] \n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD SUCCESS\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time:  01:29 min\n[INFO] Finished at: 2023-07-03T11:26:39+02:00\n[INFO] ------------------------------------------------------------------------<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\u68c0\u67e5\u521b\u5efa\u7684-docker-\u6620\u50cf\">\u68c0\u67e5\u521b\u5efa\u7684 Docker \u6620\u50cf<\/h2>\n\n\n\n<p>\u5728\u6784\u5efa\u8fc7\u7a0b\u4e2d\u4e0b\u8f7d\u5e76\u521b\u5efa\u4e86\u5404\u79cd\u6620\u50cf\uff0c\u5982\u60a8\u6240\u89c1\uff0c\u6570\u91cf\u591a\u4e8e\u9884\u671f\uff0c\u4f46\u5176\u4e2d\u4e00\u4e9b\u6620\u50cf\u5728\u5355\u5143\u6d4b\u8bd5\u671f\u95f4\u4f7f\u7528\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$ docker images\n\nREPOSITORY                   TAG              IMAGE ID       CREATED        SIZE\npaketobuildpacks\/run         base-cnb         f2e5000af0cb   3 days ago     87.1MB\npostgres                     15.3             1921dda0e2c5   2 weeks ago    412MB\nmysql                        5.7              2be84dd575ee   2 weeks ago    569MB\ntestcontainers\/ryuk          0.5.1            ec913eeff75a   6 weeks ago    12.7MB\npaketobuildpacks\/builder     base             99ec7fb86b9d   43 years ago   1.34GB\npaketobuildpacks\/azul-zulu   latest           276db25e20db   43 years ago   10.4MB\npaketobuildpacks\/java        latest           2ddc6cc7d346   43 years ago   207MB\nspring-petclinic             3.1.0-SNAPSHOT   c05d70c78109   43 years ago   496MB<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\u8fd0\u884c-docker-\u6620\u50cf\">\u8fd0\u884c Docker \u6620\u50cf<\/h2>\n\n\n\n<p>\u73b0\u5728\u53ef\u4ee5\u542f\u52a8 Docker \u6620\u50cf\u3002\u9488\u5bf9\u4e0d\u540c\u7528\u4f8b\u914d\u7f6e\u4e86\u4e09\u4e2a\u7aef\u53e3\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>8080<\/strong>\uff1a\u7528\u4e8e\u8bbf\u95ee\u7f51\u7ad9<\/li>\n\n\n\n<li><strong>8000<\/strong>\uff1a\u8c03\u8bd5\u7aef\u53e3<\/li>\n\n\n\n<li><strong>5000<\/strong>\uff1aJMX \u7aef\u53e3<\/li>\n<\/ul>\n\n\n\n<p>\u901a\u8fc7\u7ec8\u7aef\u542f\u52a8 Docker \u6620\u50cf\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$ docker run -p 8080:8080 -p 8000:8000 -p 5000:5000 --name petclinic spring-petclinic:3.1.0-SNAPSHOT\n\nSetting Active Processor Count to 16\nDebugging enabled on port *:8000\nEnabling Java Flight Recorder with args: dumponexit=true,filename=\/tmp\/rec.jfr,duration=600s\nJMX enabled on port 5000\n...\n[0.349s][info][jfr,startup] Started recording 1. The result will be written to:\n[0.349s][info][jfr,startup] \n[0.349s][info][jfr,startup] \/tmp\/rec.jfr\n\n\n              |\\      _,,,--,,_\n             \/,`.-'`'   ._  \\-;;,_\n  _______ __|,4-  ) )_   .;.(__`'-'__     ___ __    _ ___ _______\n |       | '---''(_\/._)-'(_\\_)   |   |   |   |  |  | |   |       |\n |    _  |    ___|_     _|       |   |   |   |   |_| |   |       | __ _ _\n |   |_| |   |___  |   | |       |   |   |   |       |   |       | \\ \\ \\ \\\n |    ___|    ___| |   | |      _|   |___|   |  _    |   |      _|  \\ \\ \\ \\\n |   |   |   |___  |   | |     |_|       |   | | |   |   |     |_    ) ) ) )\n |___|   |_______| |___| |_______|_______|___|_|  |__|___|_______|  \/ \/ \/ \/\n ==================================================================\/_\/_\/_\/\n\n:: Built with Spring Boot :: 3.1.1\n\n\n2023-07-06T10:55:23.329Z  INFO 1 --- [           main] o.s.s.petclinic.PetClinicApplication     : Starting PetClinicApplication v3.1.0-SNAPSHOT using Java 17.0.7 with PID 1 (\/workspace\/BOOT-INF\/classes started by cnb in \/workspace)\n...<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\u9a8c\u8bc1-docker-\u6620\u50cf\">\u9a8c\u8bc1 Docker \u6620\u50cf<\/h2>\n\n\n\n<p>\u6b64\u65f6\u53ef\u4ee5\u6267\u884c\u4e0d\u540c\u6b65\u9aa4\u6765\u9a8c\u8bc1\u6211\u4eec\u4f7f\u7528\u9644\u52a0\u8bbe\u7f6e\u521b\u5efa\u7684 Docker \u6620\u50cf\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6253\u5f00\u6d4f\u89c8\u5668\u5e76\u5c06\u5176\u6307\u5411&nbsp;localhost:8080\u3002Petclinic Web \u754c\u9762\u53ef\u7528\u4e8e\u6d4f\u89c8\u5ba0\u7269\u4e3b\u4eba\u548c\u517d\u533b\u3002<\/li>\n\n\n\n<li>\u6253\u5f00\u7b2c\u4e8c\u4e2a\u7ec8\u7aef\u5e76\u5728\u8fd0\u884c\u7684 Docker \u5185\u90e8\u6267\u884c\u4ee5\u4e0b\u68c0\u67e5\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$ docker exec -it petclinic sh\n\n# Check the Java version\n$ \/layers\/paketo-buildpacks_azul-zulu\/jdk\/bin\/java -version\nopenjdk version \"17.0.7\" 2023-04-18 LTS\nOpenJDK Runtime Environment Zulu17.42+19-CA (build 17.0.7+7-LTS)\nOpenJDK 64-Bit Server VM Zulu17.42+19-CA (build 17.0.7+7-LTS, mixed mode, sharing)\n\n# Check if we can execute JCMD which is not included in the default build with a JRE\n$ \/layers\/paketo-buildpacks_azul-zulu\/jdk\/bin\/jcmd\n1 org.springframework.boot.loader.JarLauncher\n181 jdk.jcmd\/sun.tools.jcmd.JCmd\n\n# Check the generated files we can use later for further investigation\n# The application must be running for a longer time, before data is saved in rec.jfr\n$ ls -l \/tmp\ntotal 20\ndrwxr-xr-x 2 cnb cnb 4096 Jul 10 06:44 2023_07_10_06_44_57_1\n-rw-r--r-- 1 cnb cnb 1819 Jul 10 06:45 gc.log\ndrwxr-xr-x 2 cnb cnb 4096 Jul 10 06:44 hsperfdata_cnb\n-rw-r--r-- 1 cnb cnb    0 Jul 10 06:44 rec.jfr\ndrwx------ 2 cnb cnb 4096 Jul 10 06:44 tomcat-docbase.8080.16382390067193381204\ndrwx------ 3 cnb cnb 4096 Jul 10 06:44 tomcat.8080.7527925084169386730\n\n# Check the Java info, using Process ID 1 we found with jcmd\n$ \/layers\/paketo-buildpacks_azul-zulu\/jdk\/bin\/jinfo 1\n\nJava System Properties:\n#Mon Jul 10 06:46:46 UTC 2023\ncom.sun.management.jmxremote.rmi.port=5000\njava.specification.version=17\nsun.jnu.encoding=ANSI_X3.4-1968\ncom.sun.management.jmxremote.authenticate=false\njava.class.path=\/workspace\njava.vm.vendor=Azul Systems, Inc.\n...\njava.library.path=\/layers\/paketo-buildpacks_azul-zulu\/jdk\/lib\\:\/usr\/java\/packages\/lib\\:\/usr\/lib64\\:\/lib64\\:\/lib\\:\/usr\/lib\n...\n\nVM Flags:\n-XX:ActiveProcessorCount=16 -XX:CICompilerCount=12 -XX:CompressedClassSpaceSize=117440512 -XX:ConcGCThreads=3 -XX:+ExitOnOutOfMemoryError -XX:+FlightRecorder -XX:G1ConcRefinementThreads=13 -XX:G1EagerReclaimRemSetThreshold=128 -XX:G1HeapRegionSize=16777216 -XX:GCDrainStackTargetSize=64 -XX:InitialHeapSize=536870912 -XX:+ManagementServer -XX:MarkStackSize=4194304 -XX:MaxDirectMemorySize=10485760 -XX:MaxHeapSize=23857201152 -XX:MaxMetaspaceSize=133729280 -XX:MaxNewSize=14310965248 -XX:MinHeapDeltaBytes=16777216 -XX:MinHeapSize=16777216 -XX:NativeMemoryTracking=summary -XX:NonNMethodCodeHeapSize=7602480 -XX:NonProfiledCodeHeapSize=122027880 -XX:+PrintNMTStatistics -XX:ProfiledCodeHeapSize=122027880 -XX:ReservedCodeCacheSize=251658240 -XX:+SegmentedCodeCache -XX:SoftMaxHeapSize=23857201152 -XX:StartFlightRecording=dumponexit=true,filename=\/tmp\/rec.jfr,duration=600s -XX:ThreadStackSize=1024 -XX:+UnlockDiagnosticVMOptions -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseFastUnorderedTimeStamps -XX:+UseG1GC \n\nVM Arguments:\njvm_args: -Djava.security.properties=\/layers\/paketo-buildpacks_azul-zulu\/java-security-properties\/java-security.properties -XX:+ExitOnOutOfMemoryError -Xlog:gc:\/tmp\/gc.log -XX:ActiveProcessorCount=16 -agentlib:jdwp=transport=dt_socket,server=y,address=*:8000,suspend=n -XX:StartFlightRecording=dumponexit=true,filename=\/tmp\/rec.jfr,duration=600s -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5000 -Dcom.sun.management.jmxremote.rmi.port=5000 -XX:MaxDirectMemorySize=10M -Xmx23297904K -XX:MaxMetaspaceSize=130595K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics -Dorg.springframework.cloud.bindings.boot.enable=true \njava_command: org.springframework.boot.loader.JarLauncher\njava_class_path (initial): \/workspace\nLauncher Type: SUN_STANDARD<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\u5229\u7528\u65e5\u5fd7\u548c\u8c03\u8bd5\u914d\u7f6e\">\u5229\u7528\u65e5\u5fd7\u548c\u8c03\u8bd5\u914d\u7f6e<\/h2>\n\n\n\n<p>\u6709\u5173\u501f\u52a9\u5404\u79cd\u5de5\u5177\u548c\u914d\u7f6e\u6765\u5206\u6790\u548c\u8c03\u8bd5 Docker \u5185\u90e8\u5e94\u7528\u7a0b\u5e8f\uff0c\u672c\u6587\u5c06\u4e0d\u505a\u8ba8\u8bba\uff0c\u4e0d\u8fc7\u6211\u4eec\u53ef\u5bf9\u6240\u6709\u8fd9\u4e9b\u9879\u76ee\u8fdb\u884c\u5feb\u901f\u9a8c\u8bc1\uff0c\u786e\u8ba4\u5176\u914d\u7f6e\u662f\u5426\u6b63\u786e\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-\u4ece-docker-\u4e2d\u53d6\u51fa\u6587\u4ef6\">\u4ece Docker \u4e2d\u53d6\u51fa\u6587\u4ef6<\/h3>\n\n\n\n<p>\u60a8\u53ef\u5c06 Docker \u6620\u50cf\u5185\u90e8\u7684 JFR \u8bb0\u5f55\u548c\u5783\u573e\u56de\u6536\u5668\u6587\u4ef6\u590d\u5236\u5230\u60a8\u7684 PC\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$ docker cp petclinic:\/tmp\/rec.jfr rec.jfr\n$ docker cp petclinic:\/tmp\/gc.log gc.log<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-\u8fde\u63a5\u4e0e\u8c03\u8bd5\">\u8fde\u63a5\u4e0e\u8c03\u8bd5<\/h3>\n\n\n\n<p>\u5728 IDE\uff08\u4f8b\u5982 IntelliJ IDEA\uff09\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u7aef\u53e3 8000 \u542f\u52a8\u4e0e Docker \u5185\u90e8\u6b63\u5728\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u8c03\u8bd5\u8fde\u63a5\uff0c\u5e76\u5728\u4ee3\u7801\u4e2d\u8bbe\u7f6e\u65ad\u70b9\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Connected to the target VM, address: 'localhost:8000', transport: 'socket'<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"663\" data-id=\"63257\" src=\"https:\/\/azul.imgix.net\/wp-content\/uploads\/debug-config-1-1024x663.png?auto=format&crop=faces,entropy&fit=max&q=80&s=d6c88f6b069e0d30e2c344eddb5bd54a\" alt=\"\" class=\"wp-image-63257\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"812\" data-id=\"63262\" src=\"https:\/\/azul.imgix.net\/wp-content\/uploads\/debug-breakpoint-1024x812-1.jpg?auto=format&crop=faces,entropy&fit=max&q=80&s=274c03e1088b10a723eb0ad8e6019d04\" alt=\"Dubug Breakpoint\" class=\"wp-image-63262\"\/><\/figure>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-\u8fde\u63a5\u5230-jmx\">\u8fde\u63a5\u5230 JMX<\/h3>\n\n\n\n<p>\u7aef\u53e3 5000 \u4e0a\u914d\u7f6e\u7684 JMX \u8fde\u63a5\u5141\u8bb8\u60a8\u4f7f\u7528 VisualVM \u6216&nbsp;<a href=\"https:\/\/docs.azul.com\/azul-mission-control\/\" target=\"_blank\" rel=\"noreferrer noopener\">Azul Mission Control<\/a> \u8fde\u63a5\u5230 Docker \u5185\u90e8\u6b63\u5728\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u5728\u7ed9\u5b9a\u7684\u6301\u7eed\u65f6\u95f4\u5185\u542f\u52a8 JFR \u8bb0\u5f55\uff0c\u5e76\u7acb\u5373\u5c06\u7ed3\u679c\u53ef\u89c6\u5316\u3002<\/p>\n\n\n\n<p>\u70b9\u51fb\u4e0b\u65b9\u4e09\u5e45\u56fe\u7247\u4e2d\u7684\u4efb\u610f\u4e00\u5e45\u53ef\u67e5\u770b\u76f8\u5e94\u5927\u56fe\u3002<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"502\" data-id=\"63930\" src=\"https:\/\/azul.imgix.net\/wp-content\/uploads\/8-10-23-springboot-jmx-config.png?auto=format&crop=faces,entropy&fit=max&q=80&s=4bd313f821ba25bf2a9faa045002a85d\" alt=\"\" class=\"wp-image-63930\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"722\" height=\"619\" data-id=\"63920\" src=\"https:\/\/azul.imgix.net\/wp-content\/uploads\/8-10-23-springboot-jmx-jfr-recording.png?auto=format&crop=faces,entropy&fit=max&q=80&s=2ff40b46d457ff136a77b3dc1276a78f\" alt=\"\" class=\"wp-image-63920\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" data-id=\"63925\" src=\"https:\/\/azul.imgix.net\/wp-content\/uploads\/8-10-23-springboot-jmx-result-1024x662.png?auto=format&crop=faces,entropy&fit=max&q=80&s=861f8b37d96487a94ab3b3b288813aa9\" alt=\"\" class=\"wp-image-63925\"\/><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\u7ed3\u8bed\">\u7ed3\u8bed<\/h2>\n\n\n\n<p>\u672c\u6587\u7684\u6269\u5c55&nbsp;pom.xml&nbsp;\u914d\u7f6e\u5305\u62ec\u542f\u7528\u8fdc\u7a0b\u8c03\u8bd5\u548c\u751f\u6210\u65e5\u5fd7\u6587\u4ef6\u7684\u5404\u79cd\u65b9\u6cd5\u3002\u5207\u52ff\u540c\u65f6\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5e76\u4e14\u7edd\u5bf9\u4e0d\u53ef\u5c06\u5176\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u3002\u6211\u4eec\u7684\u76ee\u6807\u53ea\u662f\u786e\u5b9a Spring Boot Docker \u4e2d\u7684\u9ed8\u8ba4 Java \u53d1\u884c\u7248\u662f\u5426\u53ef\u7531\u5176\u4ed6\u8bbe\u7f6e\u8fdb\u884c\u66ff\u6362\u548c\u6269\u5c55\u3002<\/p>\n\n\n\n<p>\u90a3\u4e48\uff0c\u5927\u529f\u544a\u6210\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\"><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>\u501f\u52a9 Spring Boot Maven \u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u4ece\u5e94\u7528\u7a0b\u5e8f\u4e2d\u8f7b\u677e\u521b\u5efa Docker \u6620\u50cf\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u914d\u7f6e [&hellip;]<\/p>\n","protected":false},"author":50,"featured_media":64023,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[212,266],"tags":[100],"resource_categories":[],"industry":[],"product":[],"role":[],"resource_topic":[],"class_list":["post-64952","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-212","category-java-news-updates","tag-openjdk"],"acf":{"article_smart_summary":null,"article_sidebar_nav_items":null,"article_cta":null,"block_background_image":null,"block_background_image_sizing":null,"block_background_overflow":null,"block_background_color":null,"inline_link":null,"text_color":null,"block_margin_top":null,"block_padding_top":null,"block_padding_bottom":null,"block_margin_bottom":null,"link":null,"appearance":null,"color":null,"show_arrow":null,"style":null,"image":null,"background_color":null,"background_image":null,"overline":null,"overline_options":null,"headline":null,"headline_options":null,"description":null,"description_options":null,"cta":null,"text_align":null,"chart_type":null,"chart_options":null,"chart_labels":null,"chart_datasets":null,"countdown_date_time":null,"countdown_clock_color":null,"countdown_label_color":null,"size":null,"use_gradient_text":null,"start_color":null,"end_color":null,"name":null,"iconify":null,"logos":null,"form_headline":null,"form_number":null,"form_redirect_enabled":null,"redirect":null,"form_translation_disable":null,"zi_id":null,"zi_fields":null,"zi_lookup_field":null,"cookie_name":null,"cookie_redirect":null,"drift_playbook_campaign_id":null,"input":null,"button":null,"logo":null,"ctas":null,"alignment":null,"cta_alignment":null,"grid_layout":null,"show_featured_images":null,"show_excerpts":null,"featured_image_size":null,"cards":null,"thank_you_page_enable":null,"banner_image":null,"subheadline":null,"download_button":null,"featured_video":null,"additional_videos":null,"smart_content":null,"animation":null,"video_type":null,"vimeo_video_id":null,"youtube_video_id":null,"upload":null},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf - Azul | Better Java Performance, Superior Java Support<\/title>\n<meta name=\"description\" content=\"\u672c\u6587\u5c06\u4ecb\u7ecd\u914d\u7f6e Spring Boot \u7684\u66f4\u591a\u6280\u5de7\u548c\u793a\u4f8b\uff0c\u4ee5\u5b9a\u4e49\u6b64\u7c7b Spring Boot Docker \u6620\u50cf\u4e2d\u4f7f\u7528\u7684 Java \u8fd0\u884c\u65f6\uff0c\u5e76\u89e3\u91ca\u5982\u4f55\u6dfb\u52a0\u5176\u4ed6\u73af\u5883\u9009\u9879\u6765\u7b80\u5316\u8c03\u8bd5\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf\" \/>\n<meta property=\"og:description\" content=\"\u501f\u52a9 Spring Boot Maven \u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u4ece\u5e94\u7528\u7a0b\u5e8f\u4e2d\u8f7b\u677e\u521b\u5efa Docker \u6620\u50cf\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u914d\u7f6e Spring Boot \u7684\u66f4\u591a\u6280\u5de7\u548c\u793a\u4f8b\uff0c\u4ee5\u5b9a\u4e49\u6b64\u7c7b Spring Boot Docker \u6620\u50cf\u4e2d\u4f7f\u7528\u7684 Java \u8fd0\u884c\u65f6\uff0c\u5e76\u89e3\u91ca\u5982\u4f55\u6dfb\u52a0\u5176\u4ed6\u73af\u5883\u9009\u9879\u6765\u7b80\u5316\u8c03\u8bd5\u3002 \u672c\u6587\u7684\u64b0\u5199\u5f97\u5230 Spring\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/\" \/>\n<meta property=\"og:site_name\" content=\"Azul | Better Java Performance, Superior Java Support\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AzulSystemsInc\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-10T12:01:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-28T20:24:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.azul.com\/wp-content\/uploads\/8-10-23-blog-springboot-hero-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Frank Delporte\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@azulsystems\" \/>\n<meta name=\"twitter:site\" content=\"@azulsystems\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Frank Delporte\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/\"},\"author\":{\"name\":\"Frank Delporte\",\"@id\":\"https:\\\/\\\/www.azul.com\\\/#\\\/schema\\\/person\\\/33f8c56c1520a3aa656ad7a2c143b6cc\"},\"headline\":\"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf\",\"datePublished\":\"2023-08-10T12:01:00+00:00\",\"dateModified\":\"2023-09-28T20:24:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/\"},\"wordCount\":114,\"publisher\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.azul.com\\\/wp-content\\\/uploads\\\/8-10-23-blog-springboot-hero-1.jpg\",\"keywords\":[\"OpenJDK\"],\"articleSection\":{\"1\":\"Java News &amp; Updates\"},\"inLanguage\":\"zh-CN\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/\",\"url\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/\",\"name\":\"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf - Azul | Better Java Performance, Superior Java Support\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.azul.com\\\/wp-content\\\/uploads\\\/8-10-23-blog-springboot-hero-1.jpg\",\"datePublished\":\"2023-08-10T12:01:00+00:00\",\"dateModified\":\"2023-09-28T20:24:57+00:00\",\"description\":\"\u672c\u6587\u5c06\u4ecb\u7ecd\u914d\u7f6e Spring Boot \u7684\u66f4\u591a\u6280\u5de7\u548c\u793a\u4f8b\uff0c\u4ee5\u5b9a\u4e49\u6b64\u7c7b Spring Boot Docker \u6620\u50cf\u4e2d\u4f7f\u7528\u7684 Java \u8fd0\u884c\u65f6\uff0c\u5e76\u89e3\u91ca\u5982\u4f55\u6dfb\u52a0\u5176\u4ed6\u73af\u5883\u9009\u9879\u6765\u7b80\u5316\u8c03\u8bd5\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.azul.com\\\/wp-content\\\/uploads\\\/8-10-23-blog-springboot-hero-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.azul.com\\\/wp-content\\\/uploads\\\/8-10-23-blog-springboot-hero-1.jpg\",\"width\":1280,\"height\":500,\"caption\":\"Configuring Spring Boot to Build a Docker Image with Azul Zulu and Debug Options\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.azul.com\\\/blog\\\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.azul.com\\\/zh-hans\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.azul.com\\\/#website\",\"url\":\"https:\\\/\\\/www.azul.com\\\/\",\"name\":\"Azul | Better Java Performance, Superior Java Support\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.azul.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-CN\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.azul.com\\\/#organization\",\"name\":\"Azul\",\"alternateName\":\"Azul Systems\",\"url\":\"https:\\\/\\\/www.azul.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\\\/\\\/www.azul.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.azul.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/logo.svg\",\"contentUrl\":\"https:\\\/\\\/www.azul.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/logo.svg\",\"width\":112,\"height\":48,\"caption\":\"Azul\"},\"image\":{\"@id\":\"https:\\\/\\\/www.azul.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/AzulSystemsInc\",\"https:\\\/\\\/x.com\\\/azulsystems\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCSoJZa--HhjV9iXtbHUmm8A\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/azul-systems\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.azul.com\\\/#\\\/schema\\\/person\\\/33f8c56c1520a3aa656ad7a2c143b6cc\",\"name\":\"Frank Delporte\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/49bc68b710662ce7112adc936bb9144274a2408234cb42fe4457fa12235e03e1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/49bc68b710662ce7112adc936bb9144274a2408234cb42fe4457fa12235e03e1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/49bc68b710662ce7112adc936bb9144274a2408234cb42fe4457fa12235e03e1?s=96&d=mm&r=g\",\"caption\":\"Frank Delporte\"},\"description\":\"Senior Technical Writer and Java Champion, Azul\",\"jobTitle\":\"Java Champion\",\"url\":\"https:\\\/\\\/www.azul.com\\\/zh-hans\\\/blog\\\/author\\\/fdelporte\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf - Azul | Better Java Performance, Superior Java Support","description":"\u672c\u6587\u5c06\u4ecb\u7ecd\u914d\u7f6e Spring Boot \u7684\u66f4\u591a\u6280\u5de7\u548c\u793a\u4f8b\uff0c\u4ee5\u5b9a\u4e49\u6b64\u7c7b Spring Boot Docker \u6620\u50cf\u4e2d\u4f7f\u7528\u7684 Java \u8fd0\u884c\u65f6\uff0c\u5e76\u89e3\u91ca\u5982\u4f55\u6dfb\u52a0\u5176\u4ed6\u73af\u5883\u9009\u9879\u6765\u7b80\u5316\u8c03\u8bd5\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/","og_locale":"zh_CN","og_type":"article","og_title":"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf","og_description":"\u501f\u52a9 Spring Boot Maven \u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u4ece\u5e94\u7528\u7a0b\u5e8f\u4e2d\u8f7b\u677e\u521b\u5efa Docker \u6620\u50cf\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u914d\u7f6e Spring Boot \u7684\u66f4\u591a\u6280\u5de7\u548c\u793a\u4f8b\uff0c\u4ee5\u5b9a\u4e49\u6b64\u7c7b Spring Boot Docker \u6620\u50cf\u4e2d\u4f7f\u7528\u7684 Java \u8fd0\u884c\u65f6\uff0c\u5e76\u89e3\u91ca\u5982\u4f55\u6dfb\u52a0\u5176\u4ed6\u73af\u5883\u9009\u9879\u6765\u7b80\u5316\u8c03\u8bd5\u3002 \u672c\u6587\u7684\u64b0\u5199\u5f97\u5230 Spring","og_url":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/","og_site_name":"Azul | Better Java Performance, Superior Java Support","article_publisher":"https:\/\/www.facebook.com\/AzulSystemsInc","article_published_time":"2023-08-10T12:01:00+00:00","article_modified_time":"2023-09-28T20:24:57+00:00","og_image":[{"width":1280,"height":500,"url":"https:\/\/www.azul.com\/wp-content\/uploads\/8-10-23-blog-springboot-hero-1.jpg","type":"image\/jpeg"}],"author":"Frank Delporte","twitter_card":"summary_large_image","twitter_creator":"@azulsystems","twitter_site":"@azulsystems","twitter_misc":{"\u4f5c\u8005":"Frank Delporte","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/#article","isPartOf":{"@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/"},"author":{"name":"Frank Delporte","@id":"https:\/\/www.azul.com\/#\/schema\/person\/33f8c56c1520a3aa656ad7a2c143b6cc"},"headline":"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf","datePublished":"2023-08-10T12:01:00+00:00","dateModified":"2023-09-28T20:24:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/"},"wordCount":114,"publisher":{"@id":"https:\/\/www.azul.com\/#organization"},"image":{"@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/#primaryimage"},"thumbnailUrl":"https:\/\/www.azul.com\/wp-content\/uploads\/8-10-23-blog-springboot-hero-1.jpg","keywords":["OpenJDK"],"articleSection":{"1":"Java News &amp; Updates"},"inLanguage":"zh-CN"},{"@type":"WebPage","@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/","url":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/","name":"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf - Azul | Better Java Performance, Superior Java Support","isPartOf":{"@id":"https:\/\/www.azul.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/#primaryimage"},"image":{"@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/#primaryimage"},"thumbnailUrl":"https:\/\/www.azul.com\/wp-content\/uploads\/8-10-23-blog-springboot-hero-1.jpg","datePublished":"2023-08-10T12:01:00+00:00","dateModified":"2023-09-28T20:24:57+00:00","description":"\u672c\u6587\u5c06\u4ecb\u7ecd\u914d\u7f6e Spring Boot \u7684\u66f4\u591a\u6280\u5de7\u548c\u793a\u4f8b\uff0c\u4ee5\u5b9a\u4e49\u6b64\u7c7b Spring Boot Docker \u6620\u50cf\u4e2d\u4f7f\u7528\u7684 Java \u8fd0\u884c\u65f6\uff0c\u5e76\u89e3\u91ca\u5982\u4f55\u6dfb\u52a0\u5176\u4ed6\u73af\u5883\u9009\u9879\u6765\u7b80\u5316\u8c03\u8bd5\u3002","breadcrumb":{"@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/"]}]},{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/#primaryimage","url":"https:\/\/www.azul.com\/wp-content\/uploads\/8-10-23-blog-springboot-hero-1.jpg","contentUrl":"https:\/\/www.azul.com\/wp-content\/uploads\/8-10-23-blog-springboot-hero-1.jpg","width":1280,"height":500,"caption":"Configuring Spring Boot to Build a Docker Image with Azul Zulu and Debug Options"},{"@type":"BreadcrumbList","@id":"https:\/\/www.azul.com\/blog\/configuring-spring-boot-to-build-a-docker-image-with-azul-zulu-and-debug-options\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.azul.com\/zh-hans\/"},{"@type":"ListItem","position":2,"name":"\u914d\u7f6e Spring Boot \u4ee5\u4f7f\u7528 Azul Zulu \u548c\u8c03\u8bd5\u9009\u9879\u6784\u5efa Docker \u6620\u50cf"}]},{"@type":"WebSite","@id":"https:\/\/www.azul.com\/#website","url":"https:\/\/www.azul.com\/","name":"Azul | Better Java Performance, Superior Java Support","description":"","publisher":{"@id":"https:\/\/www.azul.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.azul.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-CN"},{"@type":"Organization","@id":"https:\/\/www.azul.com\/#organization","name":"Azul","alternateName":"Azul Systems","url":"https:\/\/www.azul.com\/","logo":{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/www.azul.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.azul.com\/wp-content\/uploads\/2021\/01\/logo.svg","contentUrl":"https:\/\/www.azul.com\/wp-content\/uploads\/2021\/01\/logo.svg","width":112,"height":48,"caption":"Azul"},"image":{"@id":"https:\/\/www.azul.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/AzulSystemsInc","https:\/\/x.com\/azulsystems","https:\/\/www.youtube.com\/channel\/UCSoJZa--HhjV9iXtbHUmm8A","https:\/\/www.linkedin.com\/company\/azul-systems"]},{"@type":"Person","@id":"https:\/\/www.azul.com\/#\/schema\/person\/33f8c56c1520a3aa656ad7a2c143b6cc","name":"Frank Delporte","image":{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/secure.gravatar.com\/avatar\/49bc68b710662ce7112adc936bb9144274a2408234cb42fe4457fa12235e03e1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/49bc68b710662ce7112adc936bb9144274a2408234cb42fe4457fa12235e03e1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/49bc68b710662ce7112adc936bb9144274a2408234cb42fe4457fa12235e03e1?s=96&d=mm&r=g","caption":"Frank Delporte"},"description":"Senior Technical Writer and Java Champion, Azul","jobTitle":"Java Champion","url":"https:\/\/www.azul.com\/zh-hans\/blog\/author\/fdelporte\/"}]}},"_links":{"self":[{"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/posts\/64952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/users\/50"}],"replies":[{"embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=64952"}],"version-history":[{"count":0,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/posts\/64952\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/media\/64023"}],"wp:attachment":[{"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=64952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=64952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=64952"},{"taxonomy":"resource_categories","embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/resource_categories?post=64952"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/industry?post=64952"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/product?post=64952"},{"taxonomy":"role","embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/role?post=64952"},{"taxonomy":"resource_topic","embeddable":true,"href":"https:\/\/www.azul.com\/zh-hans\/wp-json\/wp\/v2\/resource_topic?post=64952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}