{"id":85908,"date":"2026-07-27T23:49:52","date_gmt":"2026-07-27T15:49:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/85908.html"},"modified":"2026-07-27T23:49:52","modified_gmt":"2026-07-27T15:49:52","slug":"java%e9%80%9a%e8%bf%87-docker-engine-rest-api-%e8%bf%9c%e7%a8%8b%e9%87%87%e9%9b%86%e7%9b%ae%e6%a0%87-docker-%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84%e8%bf%90%e8%a1%8c%e4%bf%a1%e6%81%af","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/85908.html","title":{"rendered":"JAVA\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f"},"content":{"rendered":"<h2>Docker Inspector \u6280\u672f\u6587\u6863<\/h2>\n<p>\u7248\u672c&#xff1a;1.0.0 | \u57fa\u4e8e Java 21 | \u8fd0\u884c\u65f6\u4f9d\u8d56&#xff1a;JDK 21&#043;<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u7a0b\u5e8f\u6982\u8ff0<\/h3>\n<p>Docker Inspector \u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u547d\u4ee4\u884c\u5de5\u5177&#xff0c;\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f&#xff0c;\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>Docker \u5f15\u64ce\u7248\u672c\u4fe1\u606f&#xff08;API \u7248\u672c\u3001\u5f15\u64ce\u7248\u672c\u3001Go \u8fd0\u884c\u65f6\u7248\u672c\u3001\u7cfb\u7edf\u67b6\u6784\u3001\u5185\u6838\u7248\u672c&#xff09;<\/li>\n<li>\u5bb9\u5668\u5217\u8868\u4e0e\u72b6\u6001&#xff08;\u6240\u6709\u5bb9\u5668\u7684\u8fd0\u884c\u72b6\u6001\u3001\u955c\u50cf\u6765\u6e90\u3001\u7aef\u53e3\u6620\u5c04\u3001\u8fd0\u884c\u65f6\u957f&#xff09;<\/li>\n<li>\u955c\u50cf\u4ed3\u5e93\u6e05\u5355&#xff08;\u672c\u5730\u6240\u6709\u955c\u50cf\u7684\u6807\u7b7e\u3001\u5927\u5c0f\u3001\u521b\u5efa\u65f6\u95f4&#xff09;<\/li>\n<\/ul>\n<p>\u7a0b\u5e8f\u4ee5&#034;\u91c7\u96c6 \u2192 \u683c\u5f0f\u5316\u8f93\u51fa \u2192 \u9000\u51fa&#034;\u7684\u4e00\u6b21\u6027\u6a21\u5f0f\u8fd0\u884c&#xff0c;\u9002\u7528\u4e8e\u8fd0\u7ef4\u5de1\u68c0\u3001\u73af\u5883\u5feb\u7167\u3001\u81ea\u52a8\u5316\u811a\u672c\u96c6\u6210\u7b49\u573a\u666f\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u5b9e\u73b0\u539f\u7406<\/h3>\n<h4>2.1 \u6574\u4f53\u67b6\u6784<\/h4>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510          HTTP GET           \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502   Docker Inspector  \u2502  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25b6  \u2502   Docker Engine API  \u2502<br \/>\n\u2502   (Java 21 CLI)     \u2502  \u25c0\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500  \u2502   192.168.3.145:2375 \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518        JSON \u54cd\u5e94              \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n        \u2502<br \/>\n        \u25bc<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502  \u89e3\u6790 JSON \u2192 \u683c\u5f0f\u5316  \u2502<br \/>\n\u2502  \u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\u6d41     \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u7a0b\u5e8f\u7684\u8fd0\u884c\u6d41\u7a0b\u5982\u4e0b&#xff1a;<\/p>\n<li>\u521d\u59cb\u5316 HTTP \u5ba2\u6237\u7aef \u2014 \u6784\u5efa Java \u5185\u7f6e\u7684 HttpClient \u5b9e\u4f8b&#xff0c;\u914d\u7f6e\u8fde\u63a5\u8d85\u65f6<\/li>\n<li>\u4f9d\u6b21\u8c03\u7528\u4e09\u4e2a REST \u7aef\u70b9 \u2014 \/version\u3001\/containers\/json?all&#061;true\u3001\/images\/json<\/li>\n<li>\u89e3\u6790 JSON \u54cd\u5e94 \u2014 \u4f7f\u7528 Jackson \u5c06\u54cd\u5e94\u4f53\u89e3\u6790\u4e3a JsonNode \u6811\u7ed3\u6784<\/li>\n<li>\u63d0\u53d6\u5b57\u6bb5\u5e76\u683c\u5f0f\u5316 \u2014 \u6309\u56fa\u5b9a\u5bbd\u5ea6\u5bf9\u9f50\u8f93\u51fa\u5230\u63a7\u5236\u53f0<\/li>\n<li>\u8fdb\u7a0b\u9000\u51fa \u2014 \u6240\u6709\u6570\u636e\u8f93\u51fa\u5b8c\u6210\u540e&#xff0c;main \u65b9\u6cd5\u81ea\u7136\u8fd4\u56de&#xff0c;JVM \u9000\u51fa<\/li>\n<h4>2.2 Docker Engine REST API<\/h4>\n<p>Docker \u5b88\u62a4\u8fdb\u7a0b\u66b4\u9732\u7684 HTTP API \u662f\u672c\u7a0b\u5e8f\u7684\u6838\u5fc3\u6570\u636e\u6765\u6e90\u3002\u5f53 Docker \u4ee5 -H tcp:\/\/0.0.0.0:2375 \u65b9\u5f0f\u542f\u52a8\u65f6&#xff0c;\u5916\u90e8\u7a0b\u5e8f\u5373\u53ef\u901a\u8fc7 HTTP \u8bbf\u95ee\u3002<\/p>\n<p>\u672c\u7a0b\u5e8f\u4f7f\u7528\u4e86\u4ee5\u4e0b\u4e09\u4e2a\u7aef\u70b9&#xff1a;<\/p>\n<table>\n<tr>\u7aef\u70b9HTTP \u65b9\u6cd5\u8fd4\u56de\u5185\u5bb9<\/tr>\n<tbody>\n<tr>\n<td>\/version<\/td>\n<td>GET<\/td>\n<td>Docker \u5f15\u64ce\u7248\u672c\u3001API \u7248\u672c\u3001Go \u7248\u672c\u3001\u7cfb\u7edf\u67b6\u6784<\/td>\n<\/tr>\n<tr>\n<td>\/containers\/json?all&#061;true<\/td>\n<td>GET<\/td>\n<td>\u6240\u6709\u5bb9\u5668&#xff08;\u542b\u5df2\u505c\u6b62&#xff09;\u7684 ID\u3001\u540d\u79f0\u3001\u955c\u50cf\u3001\u72b6\u6001\u3001\u7aef\u53e3\u6620\u5c04<\/td>\n<\/tr>\n<tr>\n<td>\/images\/json<\/td>\n<td>GET<\/td>\n<td>\u672c\u5730\u6240\u6709\u955c\u50cf\u7684 ID\u3001\u6807\u7b7e\u3001\u5927\u5c0f\u3001\u521b\u5efa\u65f6\u95f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>\/version \u54cd\u5e94\u793a\u4f8b<\/h5>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;ApiVersion&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;1.49&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;Version&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;28.1.1&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;GoVersion&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;go1.23.8&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;Arch&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;amd64&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;KernelVersion&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;6.6.0-102.0.0.8.oe2509.x86_64&#034;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h5>\/containers\/json?all&#061;true \u54cd\u5e94\u793a\u4f8b<\/h5>\n<p><span class=\"token punctuation\">[<\/span><br \/>\n  <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;Id&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;9d4a2bb13848&#8230;&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;Names&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\/pascal-ming-iiot&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;Image&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;pascal-ming-iiot:6.0.0&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;State&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;running&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;Status&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;Up 11 minutes&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;Ports&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n      <span class=\"token punctuation\">{<\/span> <span class=\"token string-property property\">&#034;IP&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;0.0.0.0&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;PrivatePort&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">39999<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;PublicPort&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">39999<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string-property property\">&#034;Type&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;tcp&#034;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">]<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">]<\/span><\/p>\n<h5>\/images\/json \u54cd\u5e94\u793a\u4f8b<\/h5>\n<p><span class=\"token punctuation\">[<\/span><br \/>\n  <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;Id&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;sha256:9a50f2f8bc4c&#8230;&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;RepoTags&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;hirun-node-red:4.1.10-22&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;Size&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">981495831<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;Created&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">1749050563<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">]<\/span><\/p>\n<h4>2.3 \u4e3a\u4ec0\u4e48\u9009\u62e9\u76f4\u63a5\u8c03\u7528 REST API \u800c\u975e docker-java SDK<\/h4>\n<table>\n<tr>\u7ef4\u5ea6\u76f4\u63a5\u8c03 REST API&#xff08;\u672c\u65b9\u6848&#xff09;docker-java SDK<\/tr>\n<tbody>\n<tr>\n<td>\u4f9d\u8d56\u4f53\u79ef<\/td>\n<td>\u4ec5 Jackson&#xff08;~1.8 MB&#xff09;<\/td>\n<td>SDK &#043; Netty&#xff08;~5-8 MB&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u7248\u672c\u517c\u5bb9\u6027<\/td>\n<td>Docker API \u5411\u540e\u517c\u5bb9&#xff0c;\u6781\u5c11\u53d8\u52a8<\/td>\n<td>SDK \u7248\u672c\u9700\u4e0e Docker \u7248\u672c\u5bf9\u9f50<\/td>\n<\/tr>\n<tr>\n<td>\u5b66\u4e60\u6210\u672c<\/td>\n<td>HTTP &#043; JSON&#xff0c;\u65e0\u989d\u5916\u6982\u5ff5<\/td>\n<td>\u9700\u5b66\u4e60 SDK \u62bd\u8c61\u5c42<\/td>\n<\/tr>\n<tr>\n<td>\u53ef\u8c03\u8bd5\u6027<\/td>\n<td>curl \u53ef\u76f4\u63a5\u590d\u73b0\u8bf7\u6c42<\/td>\n<td>\u9700\u901a\u8fc7 SDK \u5185\u90e8\u65e5\u5fd7\u6392\u67e5<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u573a\u666f<\/td>\n<td>\u53ea\u8bfb\u67e5\u8be2&#xff0c;\u7aef\u70b9\u6709\u9650<\/td>\n<td>\u9700\u8981\u521b\u5efa\/\u5220\u9664\u5bb9\u5668\u7b49\u590d\u6742\u64cd\u4f5c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u672c\u7a0b\u5e8f\u4ec5\u505a\u53ea\u8bfb\u67e5\u8be2&#xff0c;\u4e09\u4e2a\u7aef\u70b9\u5df2\u8db3\u591f\u8986\u76d6\u5168\u90e8\u9700\u6c42&#xff0c;\u76f4\u63a5\u8c03 REST API \u662f\u66f4\u8f7b\u91cf\u3001\u66f4\u53ef\u63a7\u7684\u9009\u62e9\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u5173\u952e\u6280\u672f\u7ec4\u4ef6<\/h3>\n<h4>3.1 Java 21 HttpClient&#xff08;java.net.http&#xff09;<\/h4>\n<p><span class=\"token keyword\">this<\/span><span class=\"token punctuation\">.<\/span>httpClient <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">HttpClient<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">newBuilder<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">.<\/span><span class=\"token function\">connectTimeout<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Duration<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">ofSeconds<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">10<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">.<\/span><span class=\"token function\">build<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>java.net.http.HttpClient \u81ea JDK 11 \u8d77\u6210\u4e3a\u6807\u51c6 API&#xff0c;JDK 21 \u4e2d\u5df2\u5b8c\u5168\u6210\u719f\u3002\u76f8\u6bd4 Apache HttpClient \u6216 OkHttp&#xff0c;\u5b83\u96f6\u5916\u90e8\u4f9d\u8d56\u3001\u4e0e JDK \u751f\u547d\u5468\u671f\u4e00\u81f4\u3001\u652f\u6301 HTTP\/2\u3002<\/p>\n<p>\u672c\u7a0b\u5e8f\u4f7f\u7528\u540c\u6b65\u53d1\u9001\u6a21\u5f0f&#xff1a;<\/p>\n<p><span class=\"token class-name\">HttpResponse<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> response <span class=\"token operator\">&#061;<\/span> httpClient<span class=\"token punctuation\">.<\/span><span class=\"token function\">send<\/span><span class=\"token punctuation\">(<\/span>request<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">HttpResponse<span class=\"token punctuation\">.<\/span>BodyHandlers<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">ofString<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8d85\u65f6\u8bbe\u8ba1&#xff1a;\u8fde\u63a5\u8d85\u65f6 10 \u79d2\u3001\u8bf7\u6c42\u8d85\u65f6 15 \u79d2&#xff0c;\u4fdd\u8bc1\u5728\u7f51\u7edc\u4e0d\u53ef\u8fbe\u65f6\u7a0b\u5e8f\u4e0d\u4f1a\u65e0\u9650\u6302\u8d77\u3002<\/p>\n<h4>3.2 Jackson JSON \u5904\u7406<\/h4>\n<p><span class=\"token keyword\">this<\/span><span class=\"token punctuation\">.<\/span>mapper <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">ObjectMapper<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u83b7\u53d6\u65f6\u89e3\u6790<\/span><br \/>\n<span class=\"token keyword\">return<\/span> mapper<span class=\"token punctuation\">.<\/span><span class=\"token function\">readTree<\/span><span class=\"token punctuation\">(<\/span>response<span class=\"token punctuation\">.<\/span><span class=\"token function\">body<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u8fd4\u56de JsonNode \u6811<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b89\u5168\u8bfb\u53d6\u5b57\u6bb5<\/span><br \/>\n<span class=\"token class-name\">String<\/span> apiVersion <span class=\"token operator\">&#061;<\/span> version<span class=\"token punctuation\">.<\/span><span class=\"token function\">path<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;ApiVersion&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">asText<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;N\/A&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>ObjectMapper.readTree() \u5c06 JSON \u5b57\u7b26\u4e32\u89e3\u6790\u4e3a\u6811\u6a21\u578b&#xff08;JsonNode&#xff09;&#xff0c;\u901a\u8fc7 path() \u65b9\u6cd5\u5b89\u5168\u5bfc\u822a\u2014\u2014\u5b57\u6bb5\u4e0d\u5b58\u5728\u65f6\u8fd4\u56de MissingNode&#xff0c;\u8c03\u7528 asText(&#034;N\/A&#034;) \u4e0d\u4f1a\u629b\u5f02\u5e38\u800c\u662f\u8fd4\u56de\u9ed8\u8ba4\u503c&#xff0c;\u907f\u514d\u4e86\u5927\u91cf\u7684 null \u68c0\u67e5\u3002<\/p>\n<h4>3.3 Java 21 Switch \u8868\u8fbe\u5f0f&#xff08;Pattern Matching&#xff09;<\/h4>\n<p><span class=\"token class-name\">String<\/span> stateColor <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">switch<\/span> <span class=\"token punctuation\">(<\/span>state<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">case<\/span> <span class=\"token string\">&#034;running&#034;<\/span> <span class=\"token operator\">-&gt;<\/span> <span class=\"token punctuation\">{<\/span> running<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">yield<\/span> <span class=\"token string\">&#034;&#x1f7e2;&#034;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">case<\/span> <span class=\"token string\">&#034;exited&#034;<\/span>  <span class=\"token operator\">-&gt;<\/span> <span class=\"token punctuation\">{<\/span> stopped<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">yield<\/span> <span class=\"token string\">&#034;&#x1f534;&#034;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">default<\/span>        <span class=\"token operator\">-&gt;<\/span> <span class=\"token punctuation\">{<\/span> stopped<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">yield<\/span> <span class=\"token string\">&#034;&#x1f7e1;&#034;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>Java 21 \u7684 switch \u8868\u8fbe\u5f0f\u652f\u6301\u7bad\u5934\u8bed\u6cd5\u548c\u4ee3\u7801\u5757&#xff0c;\u5141\u8bb8\u5728\u5206\u652f\u4e2d\u6267\u884c\u526f\u4f5c\u7528&#xff08;running&#043;&#043;&#xff09;\u5e76\u7528 yield \u8fd4\u56de\u503c&#xff0c;\u6bd4\u4f20\u7edf\u7684 switch-case-break \u7ed3\u6784\u66f4\u7d27\u51d1\u3001\u66f4\u4e0d\u5bb9\u6613\u9057\u6f0f break\u3002<\/p>\n<h4>3.4 \u683c\u5f0f\u5316\u8f93\u51fa<\/h4>\n<p><span class=\"token class-name\">System<\/span><span class=\"token punctuation\">.<\/span>out<span class=\"token punctuation\">.<\/span><span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u2551  \u670d\u52a1\u5668\u5730\u5740    : %-35s \u2551%n&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token constant\">DOCKER_HOST<\/span> <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#034;:&#034;<\/span> <span class=\"token operator\">&#043;<\/span> <span class=\"token constant\">DOCKER_PORT<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>%-35s \u8868\u793a\u5de6\u5bf9\u9f50\u3001\u5360 35 \u5b57\u7b26\u5bbd\u5ea6&#xff0c;\u914d\u5408 Unicode \u5236\u8868\u7b26&#xff08;\u2554\u2550\u2557\u2551\u255a&#xff09;\u6784\u5efa\u56fa\u5b9a\u5bbd\u5ea6\u7684\u8868\u683c\u8fb9\u6846\u3002<\/p>\n<p>\u8f85\u52a9\u65b9\u6cd5&#xff1a;<\/p>\n<ul>\n<li>truncate(s, max) \u2014 \u8d85\u957f\u5b57\u7b26\u4e32\u622a\u65ad\u5e76\u9644\u52a0 ..&#xff0c;\u9632\u6b62\u8f93\u51fa\u6ea2\u51fa<\/li>\n<li>formatSize(bytes) \u2014 \u5b57\u8282\u81ea\u52a8\u6362\u7b97\u4e3a KB\/MB\/GB<\/li>\n<li>formatTimestamp(unixSeconds) \u2014 Unix \u65f6\u95f4\u6233\u8f6c\u672c\u5730\u65f6\u95f4\u683c\u5f0f<\/li>\n<\/ul>\n<hr \/>\n<h3>\u56db\u3001\u7a0b\u5e8f\u7ed3\u6784<\/h3>\n<h4>4.1 \u6587\u4ef6\u5e03\u5c40<\/h4>\n<p>docker-java\/<br \/>\n\u251c\u2500\u2500 pom.xml                                        # Maven \u6784\u5efa\u914d\u7f6e<br \/>\n\u251c\u2500\u2500 docs\/<br \/>\n\u2502   \u2514\u2500\u2500 README.md                                  # \u672c\u6587\u6863<br \/>\n\u251c\u2500\u2500 src\/<br \/>\n\u2502   \u2514\u2500\u2500 main\/<br \/>\n\u2502       \u2514\u2500\u2500 java\/<br \/>\n\u2502           \u2514\u2500\u2500 com\/<br \/>\n\u2502               \u2514\u2500\u2500 example\/<br \/>\n\u2502                   \u2514\u2500\u2500 DockerInspector.java        # \u4e3b\u7c7b&#xff0c;\u5355\u6587\u4ef6\u7ea6 200 \u884c<br \/>\n\u2514\u2500\u2500 target\/<br \/>\n    \u2514\u2500\u2500 docker-inspector-1.0.0.jar                  # \u6253\u5305\u4ea7\u7269&#xff08;\u542b\u5168\u90e8\u4f9d\u8d56&#xff09;<\/p>\n<h4>4.2 \u7c7b\u7ed3\u6784&#xff08;DockerInspector.java&#xff09;<\/h4>\n<p>DockerInspector<br \/>\n\u251c\u2500\u2500 \u5e38\u91cf<br \/>\n\u2502   \u251c\u2500\u2500 DOCKER_HOST \/ DOCKER_PORT \/ BASE_URL     # \u76ee\u6807\u670d\u52a1\u5668\u5730\u5740<br \/>\n\u2502<br \/>\n\u251c\u2500\u2500 \u6210\u5458<br \/>\n\u2502   \u251c\u2500\u2500 HttpClient httpClient                     # HTTP \u5ba2\u6237\u7aef&#xff08;\u7ebf\u7a0b\u5b89\u5168&#xff09;<br \/>\n\u2502   \u2514\u2500\u2500 ObjectMapper mapper                       # JSON \u89e3\u6790\u5668&#xff08;\u7ebf\u7a0b\u5b89\u5168&#xff09;<br \/>\n\u2502<br \/>\n\u251c\u2500\u2500 \u6838\u5fc3\u65b9\u6cd5<br \/>\n\u2502   \u251c\u2500\u2500 get(String path) \u2192 JsonNode              # \u901a\u7528 GET \u8bf7\u6c42\u5c01\u88c5<br \/>\n\u2502   \u251c\u2500\u2500 printDockerVersion()                      # \u8f93\u51fa\u5f15\u64ce\u7248\u672c\u4fe1\u606f<br \/>\n\u2502   \u251c\u2500\u2500 printContainers()                         # \u8f93\u51fa\u5bb9\u5668\u5217\u8868\u4e0e\u72b6\u6001<br \/>\n\u2502   \u2514\u2500\u2500 printImages()                             # \u8f93\u51fa\u955c\u50cf\u6e05\u5355<br \/>\n\u2502<br \/>\n\u251c\u2500\u2500 \u5de5\u5177\u65b9\u6cd5<br \/>\n\u2502   \u251c\u2500\u2500 truncate(String, int) \u2192 String           # \u5b57\u7b26\u4e32\u622a\u65ad<br \/>\n\u2502   \u251c\u2500\u2500 formatSize(long) \u2192 String                # \u6587\u4ef6\u5927\u5c0f\u683c\u5f0f\u5316<br \/>\n\u2502   \u2514\u2500\u2500 formatTimestamp(long) \u2192 String           # \u65f6\u95f4\u6233\u683c\u5f0f\u5316<br \/>\n\u2502<br \/>\n\u2514\u2500\u2500 main(String[] args)                           # \u5165\u53e3&#xff0c;\u4f9d\u6b21\u8c03\u7528\u4e09\u4e2a print \u65b9\u6cd5<\/p>\n<h4>4.3 \u6267\u884c\u6d41\u7a0b<\/h4>\n<p>main()<br \/>\n  \u2502<br \/>\n  \u251c\u2500\u2500 new DockerInspector()<br \/>\n  \u2502     \u251c\u2500\u2500 HttpClient.newBuilder().connectTimeout(10s).build()<br \/>\n  \u2502     \u2514\u2500\u2500 new ObjectMapper()<br \/>\n  \u2502<br \/>\n  \u251c\u2500\u2500 printDockerVersion()<br \/>\n  \u2502     \u251c\u2500\u2500 GET \/version<br \/>\n  \u2502     \u251c\u2500\u2500 mapper.readTree(body)<br \/>\n  \u2502     \u2514\u2500\u2500 printf \u8f93\u51fa\u8868\u683c<br \/>\n  \u2502<br \/>\n  \u251c\u2500\u2500 printContainers()<br \/>\n  \u2502     \u251c\u2500\u2500 GET \/containers\/json?all&#061;true<br \/>\n  \u2502     \u251c\u2500\u2500 mapper.readTree(body)<br \/>\n  \u2502     \u251c\u2500\u2500 \u904d\u5386\u6570\u7ec4 \u2192 \u63d0\u53d6 Id\/Name\/Image\/State\/Ports<br \/>\n  \u2502     \u251c\u2500\u2500 \u7edf\u8ba1 running \/ stopped \u6570\u91cf<br \/>\n  \u2502     \u2514\u2500\u2500 printf \u9010\u884c\u8f93\u51fa<br \/>\n  \u2502<br \/>\n  \u251c\u2500\u2500 printImages()<br \/>\n  \u2502     \u251c\u2500\u2500 GET \/images\/json<br \/>\n  \u2502     \u251c\u2500\u2500 mapper.readTree(body)<br \/>\n  \u2502     \u251c\u2500\u2500 \u904d\u5386\u6570\u7ec4 \u2192 \u63d0\u53d6 Id\/RepoTags\/Size\/Created<br \/>\n  \u2502     \u2514\u2500\u2500 printf \u9010\u884c\u8f93\u51fa<br \/>\n  \u2502<br \/>\n  \u2514\u2500\u2500 \u8f93\u51fa &#034;\u4fe1\u606f\u6536\u96c6\u5b8c\u6bd5&#xff0c;\u7a0b\u5e8f\u9000\u51fa\u3002&#034;<\/p>\n<h4>4.4 Maven \u6784\u5efa\u914d\u7f6e\u8981\u70b9<\/h4>\n<p><span class=\"token comment\">&lt;!&#8211; pom.xml \u5173\u952e\u914d\u7f6e &#8211;&gt;<\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>properties<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>maven.compiler.source<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>21<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>maven.compiler.source<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>   <span class=\"token comment\">&lt;!&#8211; \u7f16\u8bd1\u76ee\u6807 JDK 21 &#8211;&gt;<\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>maven.compiler.target<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>21<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>maven.compiler.target<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>properties<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependencies<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>com.fasterxml.jackson.core<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>jackson-databind<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>       <span class=\"token comment\">&lt;!&#8211; \u552f\u4e00\u5916\u90e8\u4f9d\u8d56 &#8211;&gt;<\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependencies<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>plugins<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>plugin<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>maven-shade-plugin<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>     <span class=\"token comment\">&lt;!&#8211; \u5c06\u4f9d\u8d56\u6253\u5165\u5355\u4e00 jar &#8211;&gt;<\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>plugin<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>plugins<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>maven-shade-plugin \u5c06 Jackson \u7684\u4e09\u4e2a jar&#xff08;core \/ annotations \/ databind&#xff09;\u5408\u5e76\u8fdb\u6700\u7ec8\u7684 docker-inspector-1.0.0.jar&#xff0c;\u5b9e\u73b0&#034;\u4e00\u4e2a jar \u8d70\u5929\u4e0b&#034;&#xff0c;\u76ee\u6807\u673a\u5668\u53ea\u9700\u6709 JDK 21 \u5373\u53ef\u76f4\u63a5\u8fd0\u884c\u3002<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u8fd0\u884c\u65b9\u5f0f<\/h3>\n<h4>5.1 \u7f16\u8bd1\u6253\u5305<\/h4>\n<p>mvn clean package <span class=\"token parameter variable\">-q<\/span><\/p>\n<p>\u4ea7\u51fa\u7269&#xff1a;target\/docker-inspector-1.0.0.jar&#xff08;\u542b\u5168\u90e8\u4f9d\u8d56&#xff0c;\u7ea6 2.1 MB&#xff09;<\/p>\n<h4>5.2 \u6267\u884c<\/h4>\n<p><span class=\"token comment\"># Linux \/ macOS<\/span><br \/>\n<span class=\"token function\">java<\/span> <span class=\"token parameter variable\">-jar<\/span> target\/docker-inspector-1.0.0.jar<\/p>\n<p><span class=\"token comment\"># Windows&#xff08;\u89e3\u51b3\u4e2d\u6587\u4e71\u7801&#xff09;<\/span><br \/>\n<span class=\"token function\">java<\/span> <span class=\"token parameter variable\">-Dfile.encoding<\/span><span class=\"token operator\">&#061;<\/span>UTF-8 <span class=\"token parameter variable\">-Dstdout.encoding<\/span><span class=\"token operator\">&#061;<\/span>UTF-8 <span class=\"token parameter variable\">-Dstderr.encoding<\/span><span class=\"token operator\">&#061;<\/span>UTF-8 <span class=\"token punctuation\">\\\\<\/span><br \/>\n     <span class=\"token parameter variable\">-jar<\/span> target\/docker-inspector-1.0.0.jar<\/p>\n<h4>5.3 Docker \u670d\u52a1\u5668\u524d\u7f6e\u6761\u4ef6<\/h4>\n<p>\u76ee\u6807 Docker \u5b88\u62a4\u8fdb\u7a0b\u9700\u5f00\u542f TCP \u76d1\u542c&#xff1a;<\/p>\n<p><span class=\"token comment\"># \/etc\/docker\/daemon.json \u6216 dockerd \u542f\u52a8\u53c2\u6570<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string\">&#034;hosts&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;unix:\/\/\/var\/run\/docker.sock&#034;<\/span>, <span class=\"token string\">&#034;tcp:\/\/0.0.0.0:2375&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u6216\u5728 systemd \u670d\u52a1\u6587\u4ef6\u4e2d\u8bbe\u7f6e&#xff1a;<\/p>\n<p># \/etc\/systemd\/system\/docker.service.d\/override.conf<br \/>\n[Service]<br \/>\nExecStart&#061;<br \/>\nExecStart&#061;\/usr\/bin\/dockerd -H fd:\/\/ -H tcp:\/\/0.0.0.0:2375<\/p>\n<p>\u5b89\u5168\u63d0\u793a&#xff1a;2375 \u7aef\u53e3\u65e0\u8ba4\u8bc1&#xff0c;\u751f\u4ea7\u73af\u5883\u5efa\u8bae\u542f\u7528 TLS&#xff08;2376 \u7aef\u53e3&#xff09;\u5e76\u914d\u7f6e\u5ba2\u6237\u7aef\u8bc1\u4e66\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001\u6269\u5c55\u529f\u80fd\u5c55\u671b<\/h3>\n<h4>6.1 \u547d\u4ee4\u884c\u53c2\u6570\u5316<\/h4>\n<p>\u5f53\u524d\u670d\u52a1\u5668\u5730\u5740\u786c\u7f16\u7801\u5728\u5e38\u91cf\u4e2d&#xff0c;\u53ef\u6539\u4e3a\u547d\u4ee4\u884c\u53c2\u6570\u6216\u914d\u7f6e\u6587\u4ef6\u9a71\u52a8&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u76ee\u6807\u5f62\u6001<\/span><br \/>\ndocker-inspector <span class=\"token parameter variable\">&#8211;host<\/span> <span class=\"token number\">192.168<\/span>.3.145 <span class=\"token parameter variable\">&#8211;port<\/span> <span class=\"token number\">2375<\/span><br \/>\ndocker-inspector <span class=\"token parameter variable\">&#8211;config<\/span> servers.yml<\/p>\n<p>\u6280\u672f\u65b9\u6848&#xff1a;\u5f15\u5165 picocli&#xff08;\u96f6\u4f9d\u8d56\u3001\u6ce8\u89e3\u9a71\u52a8\u7684\u547d\u4ee4\u884c\u89e3\u6790\u6846\u67b6&#xff09;\u66ff\u4ee3\u786c\u7f16\u7801\u5e38\u91cf&#xff0c;\u652f\u6301 &#8211;host\u3001&#8211;port\u3001&#8211;output json \u7b49\u53c2\u6570\u3002<\/p>\n<h4>6.2 \u591a\u670d\u52a1\u5668\u6279\u91cf\u5de1\u68c0<\/h4>\n<p>\u652f\u6301\u540c\u65f6\u8fde\u63a5\u591a\u53f0 Docker \u670d\u52a1\u5668&#xff0c;\u5e76\u53d1\u91c7\u96c6\u540e\u6c47\u603b\u8f93\u51fa&#xff1a;<\/p>\n<p>docker-inspector <span class=\"token parameter variable\">&#8211;host<\/span> <span class=\"token number\">192.168<\/span>.3.145,192.168.3.146,192.168.3.147 <span class=\"token parameter variable\">&#8211;port<\/span> <span class=\"token number\">2375<\/span><\/p>\n<p>\u6280\u672f\u65b9\u6848&#xff1a;\u4f7f\u7528 HttpClient &#043; CompletableFuture \u5e76\u53d1\u8bf7\u6c42&#xff0c;\u6216\u7ed3\u6784\u5316\u5e76\u53d1&#xff08;Java 21 StructuredTaskScope&#xff09;\u7b49\u5f85\u5168\u90e8\u5b8c\u6210\u540e\u518d\u683c\u5f0f\u5316\u8f93\u51fa\u3002<\/p>\n<h4>6.3 \u8f93\u51fa\u683c\u5f0f\u6269\u5c55<\/h4>\n<p>\u5f53\u524d\u4ec5\u652f\u6301\u63a7\u5236\u53f0\u6587\u672c\u8f93\u51fa&#xff0c;\u53ef\u6269\u5c55\u4e3a\u591a\u683c\u5f0f&#xff1a;<\/p>\n<table>\n<tr>\u683c\u5f0f\u9002\u7528\u573a\u666f\u5b9e\u73b0\u65b9\u5f0f<\/tr>\n<tbody>\n<tr>\n<td>JSON<\/td>\n<td>\u7a0b\u5e8f\u95f4\u96c6\u6210\u3001\u7ba1\u9053\u4f20\u53c2<\/td>\n<td>Jackson ObjectMapper.writeValueAsString()<\/td>\n<\/tr>\n<tr>\n<td>CSV<\/td>\n<td>\u5bfc\u5165 Excel \/ \u6570\u636e\u5206\u6790<\/td>\n<td>\u7b80\u5355\u5b57\u7b26\u4e32\u62fc\u63a5\u6216 OpenCSV<\/td>\n<\/tr>\n<tr>\n<td>HTML<\/td>\n<td>\u90ae\u4ef6\u62a5\u544a<\/td>\n<td>\u6a21\u677f\u5f15\u64ce&#xff08;FreeMarker \/ Thymeleaf&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>YAML<\/td>\n<td>\u914d\u7f6e\u7ba1\u7406\u96c6\u6210<\/td>\n<td>Jackson YAML \u6a21\u5757<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>6.4 TLS \u5b89\u5168\u8fde\u63a5<\/h4>\n<p>\u751f\u4ea7\u73af\u5883\u7684 Docker API \u901a\u5e38\u9700\u8981\u5ba2\u6237\u7aef\u8bc1\u4e66\u8ba4\u8bc1&#xff1a;<\/p>\n<p>docker-inspector <span class=\"token parameter variable\">&#8211;host<\/span> <span class=\"token number\">192.168<\/span>.3.145 <span class=\"token parameter variable\">&#8211;port<\/span> <span class=\"token number\">2376<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n                 <span class=\"token parameter variable\">&#8211;tls<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n                 <span class=\"token parameter variable\">&#8211;cert<\/span> client-cert.pem <span class=\"token punctuation\">\\\\<\/span><br \/>\n                 <span class=\"token parameter variable\">&#8211;key<\/span> client-key.pem <span class=\"token punctuation\">\\\\<\/span><br \/>\n                 <span class=\"token parameter variable\">&#8211;ca<\/span> ca.pem<\/p>\n<p>\u6280\u672f\u65b9\u6848&#xff1a;\u901a\u8fc7 SSLContext \u52a0\u8f7d PEM \u8bc1\u4e66&#xff0c;\u6ce8\u5165 HttpClient.newBuilder().sslContext(ctx)&#xff0c;\u5c06\u8fde\u63a5\u6a21\u5f0f\u4ece HTTP \u5347\u7ea7\u4e3a HTTPS &#043; mTLS\u3002<\/p>\n<h4>6.5 \u5bb9\u5668\u65e5\u5fd7\u4e0e\u5065\u5eb7\u68c0\u67e5<\/h4>\n<p>\u5728\u7248\u672c\/\u5bb9\u5668\/\u955c\u50cf\u57fa\u7840\u4e0a&#xff0c;\u589e\u52a0\u66f4\u591a\u6570\u636e\u7ef4\u5ea6&#xff1a;<\/p>\n<ul>\n<li>\u5bb9\u5668\u65e5\u5fd7\u5c3e\u90e8&#xff1a;GET \/containers\/{id}\/logs?tail&#061;50&#xff0c;\u5feb\u901f\u67e5\u770b\u6700\u8fd1\u65e5\u5fd7<\/li>\n<li>\u5bb9\u5668\u8d44\u6e90\u7edf\u8ba1&#xff1a;GET \/containers\/{id}\/stats?stream&#061;false&#xff0c;CPU \/ \u5185\u5b58 \/ \u7f51\u7edc\u5b9e\u65f6\u6570\u636e<\/li>\n<li>\u5065\u5eb7\u68c0\u67e5\u72b6\u6001&#xff1a;\u4ece\u5bb9\u5668\u8be6\u60c5\u7684 State.Health \u5b57\u6bb5\u8bfb\u53d6&#xff0c;\u8bc6\u522b unhealthy \u5bb9\u5668<\/li>\n<li>\u5bb9\u5668\u73af\u5883\u53d8\u91cf&#xff1a;GET \/containers\/{id}\/json \u2192 Config.Env&#xff0c;\u7528\u4e8e\u914d\u7f6e\u5ba1\u8ba1&#xff08;\u9700\u8131\u654f&#xff09;<\/li>\n<\/ul>\n<h4>6.6 \u6301\u7eed\u76d1\u63a7\u6a21\u5f0f<\/h4>\n<p>\u5c06\u4e00\u6b21\u6027\u91c7\u96c6\u6539\u4e3a\u5b9a\u65f6\u8f6e\u8be2&#xff0c;\u5b9e\u73b0\u7b80\u6613\u76d1\u63a7&#xff1a;<\/p>\n<p>docker-inspector <span class=\"token parameter variable\">&#8211;host<\/span> <span class=\"token number\">192.168<\/span>.3.145 <span class=\"token parameter variable\">&#8211;watch<\/span> <span class=\"token parameter variable\">&#8211;interval<\/span> 30s<\/p>\n<p>\u6280\u672f\u65b9\u6848&#xff1a;ScheduledExecutorService \u5b9a\u65f6\u89e6\u53d1\u91c7\u96c6&#xff0c;\u7ec8\u7aef\u6e05\u5c4f\u91cd\u7ed8&#xff1b;\u6216\u5c06\u6570\u636e\u63a8\u9001\u81f3 Prometheus Pushgateway \/ InfluxDB&#xff0c;\u63a5\u5165 Grafana \u5c55\u793a\u3002<\/p>\n<h4>6.7 Docker Compose \/ Stack \u670d\u52a1\u5206\u7ec4<\/h4>\n<p>\u5f53\u524d\u8f93\u51fa\u662f\u6241\u5e73\u7684\u5bb9\u5668\u5217\u8868&#xff0c;\u53ef\u6309 Compose \u9879\u76ee\u6216 Swarm Stack \u5206\u7ec4\u5c55\u793a&#xff1a;<\/p>\n<p>[project: hirun-iiot]<br \/>\n  \u251c\u2500\u2500 pascal-ming-iiot:6.0.0     running   39999\/tcp<br \/>\n  \u251c\u2500\u2500 pascal-ming-dbsync:6.0.0         exited<br \/>\n  \u251c\u2500\u2500 pascal-ming-xxljob:6.0.0         running   30020\/tcp<br \/>\n  \u2514\u2500\u2500 nodered:4.1.10-22          running   1880\/tcp<\/p>\n<p>[project: monitoring]<br \/>\n  \u251c\u2500\u2500 prometheus:v2.54.1         running   29090\/tcp<br \/>\n  \u251c\u2500\u2500 grafana:11.2.0             running   23000\/tcp<br \/>\n  \u2514\u2500\u2500 node-exporter:v1.8.2       running   29100\/tcp<\/p>\n<p>\u5b9e\u73b0\u65b9\u5f0f&#xff1a;\u4ece\u5bb9\u5668 Labels \u4e2d\u8bfb\u53d6 com.docker.compose.project \u8fdb\u884c\u5206\u7ec4\u3002<\/p>\n<h4>6.8 \u544a\u8b66\u4e0e\u901a\u77e5<\/h4>\n<p>\u589e\u52a0\u9608\u503c\u68c0\u6d4b&#xff0c;\u53d1\u73b0\u5f02\u5e38\u81ea\u52a8\u901a\u77e5&#xff1a;<\/p>\n<ul>\n<li>\u5bb9\u5668\u5904\u4e8e exited \/ restarting \u72b6\u6001\u8d85\u8fc7 N \u5206\u949f<\/li>\n<li>\u955c\u50cf\u7248\u672c\u843d\u540e\u4e8e Registry \u6700\u65b0\u7248\u672c<\/li>\n<li>\u78c1\u76d8\u5360\u7528\u8d85\u8fc7\u9608\u503c&#xff08;\u901a\u8fc7 Docker system df&#xff09;<\/li>\n<\/ul>\n<p>\u901a\u77e5\u6e20\u9053&#xff1a;\u4f01\u4e1a\u5fae\u4fe1 \/ \u9489\u9489 \/ \u90ae\u4ef6 \/ Webhook\u3002<\/p>\n<hr \/>\n<h3>\u4e03\u3001\u5df2\u77e5\u9650\u5236<\/h3>\n<table>\n<tr>\u9650\u5236\u9879\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u4ec5\u652f\u6301 HTTP<\/td>\n<td>\u5f53\u524d\u4e0d\u652f\u6301 HTTPS\/TLS&#xff0c;\u751f\u4ea7\u73af\u5883\u9700\u542f\u7528 TLS \u65f6\u9700\u6539\u9020<\/td>\n<\/tr>\n<tr>\n<td>\u65e0\u8ba4\u8bc1\u673a\u5236<\/td>\n<td>2375 \u7aef\u53e3\u65e0\u8ba4\u8bc1&#xff0c;\u7a0b\u5e8f\u4e5f\u672a\u5b9e\u73b0 Basic Auth \u6216 Token \u8ba4\u8bc1<\/td>\n<\/tr>\n<tr>\n<td>\u4e2d\u6587 Windows \u7ec8\u7aef\u4e71\u7801<\/td>\n<td>Windows \u9ed8\u8ba4 GBK \u7f16\u7801&#xff0c;\u9700\u52a0 -Dfile.encoding&#061;UTF-8 \u8fd0\u884c\u53c2\u6570<\/td>\n<\/tr>\n<tr>\n<td>\u65e0\u4ea4\u4e92\u80fd\u529b<\/td>\n<td>\u7eaf\u8f93\u51fa\u7a0b\u5e8f&#xff0c;\u4e0d\u652f\u6301\u8fc7\u6ee4\u3001\u641c\u7d22\u3001\u9009\u62e9\u6027\u67e5\u770b<\/td>\n<\/tr>\n<tr>\n<td>\u5355\u4e00\u670d\u52a1\u5668<\/td>\n<td>\u5f53\u524d\u4ec5\u652f\u6301\u8fde\u63a5\u4e00\u53f0\u670d\u52a1\u5668&#xff0c;\u4e0d\u652f\u6301\u6279\u91cf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u516b\u3001\u4f9d\u8d56\u6e05\u5355<\/h3>\n<table>\n<tr>\u4f9d\u8d56\u7248\u672c\u7528\u9014\u8bb8\u53ef\u8bc1<\/tr>\n<tbody>\n<tr>\n<td>Jackson Databind<\/td>\n<td>2.17.2<\/td>\n<td>JSON \u89e3\u6790<\/td>\n<td>Apache 2.0<\/td>\n<\/tr>\n<tr>\n<td>Jackson Core<\/td>\n<td>2.17.2<\/td>\n<td>JSON \u5e95\u5c42\u5f15\u64ce<\/td>\n<td>Apache 2.0<\/td>\n<\/tr>\n<tr>\n<td>Jackson Annotations<\/td>\n<td>2.17.2<\/td>\n<td>JSON \u6ce8\u89e3\u652f\u6301<\/td>\n<td>Apache 2.0<\/td>\n<\/tr>\n<tr>\n<td>Java HttpClient (JDK)<\/td>\n<td>21<\/td>\n<td>HTTP \u901a\u4fe1<\/td>\n<td>Oracle BCL<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6240\u6709 Jackson \u4f9d\u8d56\u901a\u8fc7 Maven \u4f20\u9012\u4f9d\u8d56\u81ea\u52a8\u5f15\u5165&#xff0c;\u65e0\u9700\u624b\u52a8\u58f0\u660e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker Inspector \u6280\u672f\u6587\u6863\u7248\u672c&#xff1a;1.0.0 | \u57fa\u4e8e Java 21 | \u8fd0\u884c\u65f6\u4f9d\u8d56&#xff1a;JDK 21\u4e00\u3001\u7a0b\u5e8f\u6982\u8ff0<br \/>\nDocker Inspector \u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u547d\u4ee4\u884c\u5de5\u5177&#xff0c;\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f&#xff0c;\u5305\u62ec&#xff1a;<br \/>\nDocker \u5f15\u64ce\u7248\u672c\u4fe1\u606f&#xff08;API \u7248\u672c\u3001\u5f15\u64ce\u7248\u672c\u3001Go \u8fd0\u884c\u65f6\u7248\u672c\u3001\u7cfb\u7edf\u67b6\u6784\u3001\u5185\u6838\u7248\u672c&#xff09;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27,99,43],"topic":[],"class_list":["post-85908","post","type-post","status-publish","format-standard","hentry","category-server","tag-docker","tag-java","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JAVA\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/85908.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JAVA\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Docker Inspector \u6280\u672f\u6587\u6863\u7248\u672c&#xff1a;1.0.0 | \u57fa\u4e8e Java 21 | \u8fd0\u884c\u65f6\u4f9d\u8d56&#xff1a;JDK 21\u4e00\u3001\u7a0b\u5e8f\u6982\u8ff0 Docker Inspector \u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u547d\u4ee4\u884c\u5de5\u5177&#xff0c;\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f&#xff0c;\u5305\u62ec&#xff1a; Docker \u5f15\u64ce\u7248\u672c\u4fe1\u606f&#xff08;API \u7248\u672c\u3001\u5f15\u64ce\u7248\u672c\u3001Go \u8fd0\u884c\u65f6\u7248\u672c\u3001\u7cfb\u7edf\u67b6\u6784\u3001\u5185\u6838\u7248\u672c&#xff09;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/85908.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-27T15:49:52+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/85908.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/85908.html\",\"name\":\"JAVA\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-27T15:49:52+00:00\",\"dateModified\":\"2026-07-27T15:49:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/85908.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/85908.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/85908.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JAVA\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JAVA\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/85908.html","og_locale":"zh_CN","og_type":"article","og_title":"JAVA\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Docker Inspector \u6280\u672f\u6587\u6863\u7248\u672c&#xff1a;1.0.0 | \u57fa\u4e8e Java 21 | \u8fd0\u884c\u65f6\u4f9d\u8d56&#xff1a;JDK 21\u4e00\u3001\u7a0b\u5e8f\u6982\u8ff0 Docker Inspector \u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u547d\u4ee4\u884c\u5de5\u5177&#xff0c;\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f&#xff0c;\u5305\u62ec&#xff1a; Docker \u5f15\u64ce\u7248\u672c\u4fe1\u606f&#xff08;API \u7248\u672c\u3001\u5f15\u64ce\u7248\u672c\u3001Go \u8fd0\u884c\u65f6\u7248\u672c\u3001\u7cfb\u7edf\u67b6\u6784\u3001\u5185\u6838\u7248\u672c&#xff09;","og_url":"https:\/\/www.wsisp.com\/helps\/85908.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-27T15:49:52+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/85908.html","url":"https:\/\/www.wsisp.com\/helps\/85908.html","name":"JAVA\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-27T15:49:52+00:00","dateModified":"2026-07-27T15:49:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/85908.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/85908.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/85908.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"JAVA\u901a\u8fc7 Docker Engine REST API \u8fdc\u7a0b\u91c7\u96c6\u76ee\u6807 Docker \u670d\u52a1\u5668\u7684\u8fd0\u884c\u4fe1\u606f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/85908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=85908"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/85908\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=85908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=85908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=85908"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=85908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}