{"id":86730,"date":"2026-07-29T07:00:28","date_gmt":"2026-07-28T23:00:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/86730.html"},"modified":"2026-07-29T07:00:28","modified_gmt":"2026-07-28T23:00:28","slug":"%e9%83%a8%e7%bd%b2%e5%ae%9e%e6%88%98%ef%bc%9bdocker-ai-agent%ef%bc%9a%e8%ae%a9ai%e4%b8%80%e9%94%ae%e9%83%a8%e7%bd%b2spring-boot%e5%88%b0%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e4%bb%8e%e6%89%93","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/86730.html","title":{"rendered":"\u90e8\u7f72\u5b9e\u6218\uff1bDocker + AI Agent\uff1a\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668\uff0c\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4"},"content":{"rendered":"<p>\u3010\u90e8\u7f72\u5b9e\u6218\u3011Docker &#043; AI Agent&#xff1a;\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668&#xff0c;\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 <\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\u8bbe\u7f6e\u65f6\u533a<\/li>\n<li>\u521b\u5efa\u5e94\u7528\u76ee\u5f55<\/li>\n<li>\u590d\u5236jar\u5305<\/li>\n<li>\u521b\u5efa\u975eroot\u7528\u6237\u8fd0\u884c<\/li>\n<li>\u5065\u5eb7\u68c0\u67e5<\/li>\n<li>JVM\u53c2\u6570&#xff1a;\u9650\u5236\u5806\u5185\u5b58\u3001\u5f00\u542fGC\u65e5\u5fd7<\/li>\n<\/ul>\n<p>\u5199\u5728\u524d\u9762 \u5199\u8fc7Spring Boot\u7684\u90fd\u61c2\u2014\u2014\u5f00\u53d1\u4e00\u65f6\u723d&#xff0c;\u90e8\u7f72\u706b\u846c\u573a\u3002<\/p>\n<p>\u6253\u5b8cjar\u5305\u5fd8\u4e86\u6539\u914d\u7f6e\u6587\u4ef6\u7684\u73af\u5883\u53d8\u91cf&#xff0c;\u4e0a\u53bb\u4e86\u8fde\u4e0d\u4e0a\u6570\u636e\u5e93\u3002\u6539\u4e86\u4ee3\u7801\u5fd8\u4e86\u66f4\u65b0Docker\u955c\u50cf&#xff0c;\u4e0a\u7ebf\u540e\u8dd1\u7684\u8fd8\u662f\u65e7\u7248\u672c\u3002\u670d\u52a1\u5668\u78c1\u76d8\u6ee1\u4e86\u6ca1\u53d1\u73b0&#xff0c;\u90e8\u7f72\u5230\u4e00\u534a\u76f4\u63a5\u5361\u6b7b\u3002<\/p>\n<p>\u8fd9\u4e9b\u7834\u4e8b\u6bcf\u4e2a\u5f00\u53d1\u8005\u90fd\u9047\u5230\u8fc7\u3002\u6211\u4eec\u56e2\u961f\u6700\u8fd1\u641e\u4e86\u4e00\u4e2a\u65b9\u6848&#xff1a;\u628aDocker\u64cd\u4f5c\u5305\u88c5\u6210MCP Tool&#xff0c;\u8ba9AI Agent\u63a5\u624b\u90e8\u7f72\u5168\u6d41\u7a0b\u2014\u2014\u4ece\u6253\u5305\u5230\u542f\u52a8\u5230\u5065\u5eb7\u68c0\u67e5&#xff0c;\u5168\u90e8\u81ea\u52a8\u5316&#xff0c;\u51fa\u9519\u4e86\u8fd8\u4f1a\u81ea\u5df1\u56de\u6eda\u3002<\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u5b8c\u6574\u62c6\u89e3\u8fd9\u5957\u65b9\u6848\u3002\u73af\u5883&#xff1a;Spring Boot 3.3.0 &#043; Docker 26 &#043; MCP\u534f\u8bae\u3002\u670d\u52a1\u5668&#xff1a;Linux&#xff08;CentOS 7\/Ubuntu 22.04\u5747\u53ef&#xff09;\u3002<\/p>\n<p>\u4e00\u3001\u624b\u5de5\u90e8\u7f72\u5230\u5e95\u6709\u591a\u70e6 \u56de\u5fc6\u4e00\u4e0b\u4f60\u4e0a\u6b21\u90e8\u7f72\u7684\u6d41\u7a0b\u3002<\/p>\n<p>\u672c\u5730 mvn clean package \u6253jar\u5305\u3002\u628ajar\u5305scp\u5230\u670d\u52a1\u5668\u3002\u4fee\u6539application-prod.yml\u91cc\u7684\u6570\u636e\u5e93\u5730\u5740\u3002docker build \u6784\u5efa\u955c\u50cf\u3002docker stop \u505c\u6389\u65e7\u5bb9\u5668\u3002docker run \u542f\u52a8\u65b0\u5bb9\u5668\u3002docker logs -f \u76ef\u7740\u65e5\u5fd7\u770b\u6709\u6ca1\u6709\u62a5\u9519\u3002\u53d1\u73b0\u6570\u636e\u5e93\u8fde\u4e0d\u4e0a&#xff0c;\u67e5\u4e86\u534a\u5929\u53d1\u73b0\u662f\u73af\u5883\u53d8\u91cf\u6ca1\u8bbe\u5bf9\u3002\u91cd\u65b0\u6539\u4e86\u73af\u5883\u53d8\u91cf&#xff0c;\u518d\u8dd1\u4e00\u904d\u3002<\/p>\n<p>\u6574\u4e2a\u8fc7\u7a0b20\u5206\u949f\u8d77\u6b65&#xff0c;\u5982\u679c\u4e2d\u95f4\u51fa\u95ee\u9898&#xff0c;\u534a\u5c0f\u65f6\u4e00\u5c0f\u65f6\u5f88\u6b63\u5e38\u3002\u4eba\u8fd8\u4f1a\u6f0f\u6b65\u9aa4\u2014\u2014\u5fd8\u4e86\u5907\u4efd\u3001\u5fd8\u4e86\u5065\u5eb7\u68c0\u67e5\u3001\u5fd8\u4e86\u6e05\u7406\u65e7\u955c\u50cf\u5bfc\u81f4\u78c1\u76d8\u6ee1\u4e86\u3002<\/p>\n<p>AI Agent\u90fd\u80fd\u5e2e\u4f60\u5e72\u3002<\/p>\n<p>\u4e8c\u3001Dockerfile\u6a21\u677f dockerfile FROM eclipse-temurin:21-jre-alpine<\/p>\n<h2>\u8bbe\u7f6e\u65f6\u533a<\/h2>\n<p>RUN apk add &#8211;no-cache tzdata &amp;&amp;  cp \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime &amp;&amp;  echo \u201cAsia\/Shanghai\u201d &gt; \/etc\/timezone<\/p>\n<h2>\u521b\u5efa\u5e94\u7528\u76ee\u5f55<\/h2>\n<p>WORKDIR \/app<\/p>\n<h2>\u590d\u5236jar\u5305<\/h2>\n<p>COPY target\/*.jar app.jar<\/p>\n<h2>\u521b\u5efa\u975eroot\u7528\u6237\u8fd0\u884c<\/h2>\n<p>RUN addgroup -S appgroup &amp;&amp; adduser -S appuser -G appgroup USER appuser<\/p>\n<h2>\u5065\u5eb7\u68c0\u67e5<\/h2>\n<p>HEALTHCHECK &#8211;interval&#061;30s &#8211;timeout&#061;5s &#8211;retries&#061;3  CMD wget &#8211;no-verbose &#8211;tries&#061;1 &#8211;spider http:\/\/localhost:8080\/actuator\/health || exit 1<\/p>\n<p>EXPOSE 8080<\/p>\n<h2>JVM\u53c2\u6570&#xff1a;\u9650\u5236\u5806\u5185\u5b58\u3001\u5f00\u542fGC\u65e5\u5fd7<\/h2>\n<p>ENTRYPOINT [\u201cjava\u201d,  \u201c-Xms256m\u201d, \u201c-Xmx512m\u201d,  \u201c-XX:&#043;UseG1GC\u201d,  \u201c-XX:MaxGCPauseMillis&#061;200\u201d,  \u201c-Djava.security.egd&#061;file:\/dev\/.\/urandom\u201d,  \u201c-jar\u201d, \u201capp.jar\u201d] docker-compose.yml&#xff1a;<\/p>\n<p>yaml version: \u20183.8\u2019<\/p>\n<p>services: app: build: . container_name: <span class=\"katex--inline\"><span class=\"katex\"><span class=\"katex-mathml\"><\/p>\n<p>         A<\/p>\n<p>         P<\/p>\n<p>          P<\/p>\n<p>          N<\/p>\n<p>         A<\/p>\n<p>         M<\/p>\n<p>         E<\/p>\n<p>         :<\/p>\n<p>         \u2212<\/p>\n<p>         m<\/p>\n<p>         y<\/p>\n<p>         a<\/p>\n<p>         p<\/p>\n<p>         p<\/p>\n<p>        p<\/p>\n<p>        o<\/p>\n<p>        r<\/p>\n<p>        t<\/p>\n<p>        s<\/p>\n<p>        :<\/p>\n<p>        \u2212<\/p>\n<p>        &#034;<\/p>\n<p>       {APP_NAME:-myapp} ports: &#8211; &#034;<\/p>\n<p>    <\/span><span class=\"katex-html\"><span class=\"base\"><span class=\"strut\" style=\"height: 0.8778em;vertical-align: -0.1944em\"><\/span><span class=\"mord\"><span class=\"mord mathnormal\">A<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">P<\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">P<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3283em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.1389em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\" style=\"margin-right: 0.109em\">N<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mord mathnormal\">A<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.109em\">M<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">E<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mrel\">:<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mord\">\u2212<\/span><span class=\"mord mathnormal\">m<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0359em\">y<\/span><span class=\"mord mathnormal\">a<\/span><span class=\"mord mathnormal\">pp<\/span><\/span><span class=\"mord mathnormal\">p<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">or<\/span><span class=\"mord mathnormal\">t<\/span><span class=\"mord mathnormal\">s<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mrel\">:<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><\/span><span class=\"base\"><span class=\"strut\" style=\"height: 0.7778em;vertical-align: -0.0833em\"><\/span><span class=\"mord\">\u2212<\/span><span class=\"mord\">&#034;<\/span><\/span><\/span><\/span><\/span>{APP_PORT:-8080}:8080&#034; environment: &#8211; SPRING_PROFILES_ACTIVE&#061;<span class=\"katex--inline\"><span class=\"katex\"><span class=\"katex-mathml\"><\/p>\n<p>         S<\/p>\n<p>         P<\/p>\n<p>         R<\/p>\n<p>         I<\/p>\n<p>         N<\/p>\n<p>          G<\/p>\n<p>          P<\/p>\n<p>         R<\/p>\n<p>         O<\/p>\n<p>         F<\/p>\n<p>         I<\/p>\n<p>         L<\/p>\n<p>         E<\/p>\n<p>          S<\/p>\n<p>          A<\/p>\n<p>         C<\/p>\n<p>         T<\/p>\n<p>         I<\/p>\n<p>         V<\/p>\n<p>         E<\/p>\n<p>         :<\/p>\n<p>         \u2212<\/p>\n<p>         p<\/p>\n<p>         r<\/p>\n<p>         o<\/p>\n<p>         d<\/p>\n<p>        \u2212<\/p>\n<p>        D<\/p>\n<p>         B<\/p>\n<p>         U<\/p>\n<p>        R<\/p>\n<p>        L<\/p>\n<p>        &#061;<\/p>\n<p>       {SPRING_PROFILES_ACTIVE:-prod} &#8211; DB_URL&#061;<\/p>\n<p>    <\/span><span class=\"katex-html\"><span class=\"base\"><span class=\"strut\" style=\"height: 0.8889em;vertical-align: -0.1944em\"><\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">S<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">P<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0077em\">R<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0785em\">I<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.109em\">N<\/span><span class=\"mord\"><span class=\"mord mathnormal\">G<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3283em\"><span class=\"\" style=\"top: -2.55em;margin-left: 0em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\" style=\"margin-right: 0.1389em\">P<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0077em\">R<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">O<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">F<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0785em\">I<\/span><span class=\"mord mathnormal\">L<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">E<\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">S<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3283em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0576em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\">A<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0715em\">C<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">T<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0785em\">I<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.2222em\">V<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">E<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mrel\">:<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mord\">\u2212<\/span><span class=\"mord mathnormal\">p<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">r<\/span><span class=\"mord mathnormal\">o<\/span><span class=\"mord mathnormal\">d<\/span><\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">\u2212<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><\/span><span class=\"base\"><span class=\"strut\" style=\"height: 0.8333em;vertical-align: -0.15em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0502em\">B<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3283em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0502em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\" style=\"margin-right: 0.109em\">U<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0077em\">R<\/span><span class=\"mord mathnormal\">L<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mrel\">&#061;<\/span><\/span><\/span><\/span><\/span>{DB_URL} &#8211; DB_USERNAME&#061;<span class=\"katex--inline\"><span class=\"katex\"><span class=\"katex-mathml\"><\/p>\n<p>         D<\/p>\n<p>          B<\/p>\n<p>          U<\/p>\n<p>         S<\/p>\n<p>         E<\/p>\n<p>         R<\/p>\n<p>         N<\/p>\n<p>         A<\/p>\n<p>         M<\/p>\n<p>         E<\/p>\n<p>        \u2212<\/p>\n<p>        D<\/p>\n<p>         B<\/p>\n<p>         P<\/p>\n<p>        A<\/p>\n<p>        S<\/p>\n<p>        S<\/p>\n<p>        W<\/p>\n<p>        O<\/p>\n<p>        R<\/p>\n<p>        D<\/p>\n<p>        &#061;<\/p>\n<p>       {DB_USERNAME} &#8211; DB_PASSWORD&#061;<\/p>\n<p>    <\/span><span class=\"katex-html\"><span class=\"base\"><span class=\"strut\" style=\"height: 0.8333em;vertical-align: -0.15em\"><\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0502em\">B<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3283em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0502em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\" style=\"margin-right: 0.109em\">U<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">S<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">E<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0077em\">R<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.109em\">N<\/span><span class=\"mord mathnormal\">A<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.109em\">M<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">E<\/span><\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">\u2212<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><\/span><span class=\"base\"><span class=\"strut\" style=\"height: 0.8333em;vertical-align: -0.15em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0502em\">B<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3283em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0502em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\" style=\"margin-right: 0.1389em\">P<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mord mathnormal\">A<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">S<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0576em\">S<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">W<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">O<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0077em\">R<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mrel\">&#061;<\/span><\/span><\/span><\/span><\/span>{DB_PASSWORD} &#8211; REDIS_HOST&#061;${REDIS_HOST:-redis} volumes: &#8211; .\/logs:\/app\/logs restart: unless-stopped healthcheck: test: [\u201cCMD\u201d, \u201ccurl\u201d, \u201c-f\u201d, \u201chttp:\/\/localhost:8080\/actuator\/health\u201d] interval: 30s timeout: 5s retries: 5 start_period: 60s networks: &#8211; app-network<\/p>\n<p>networks: app-network: driver: bridge \u4e09\u3001\u90e8\u7f72\u64cd\u4f5cTool\u2014\u2014\u7ed9AI\u7684\u64cd\u4f5c\u63a5\u53e3 java &#064;Component public class DockerDeployTool {<\/p>\n<p>&#064;Tool(description &#061; &#034;\u6267\u884c\u5b8c\u6574\u7684\u90e8\u7f72\u6d41\u7a0b&#xff1a;1.\u7f16\u8bd1\u6253\u5305 2.\u6784\u5efaDocker\u955c\u50cf 3.\u505c\u6b62\u65e7\u5bb9\u5668 4.\u542f\u52a8\u65b0\u5bb9\u5668 5.\u5065\u5eb7\u68c0\u67e5\u3002&#034; &#043;<br \/>\n        &#034;\u4efb\u4f55\u4e00\u6b65\u5931\u8d25\u90fd\u4f1a\u81ea\u52a8\u56de\u6eda\u5230\u4e0a\u4e00\u4e2a\u53ef\u7528\u7248\u672c\u3002&#034; &#043;<br \/>\n        &#034;\u90e8\u7f72\u524d\u786e\u4fdd.gitignore\u5df2\u914d\u7f6e&#xff0c;\u907f\u514d\u63d0\u4ea4\u654f\u611f\u6587\u4ef6&#034;)<br \/>\npublic String deploy(<br \/>\n        &#064;ToolParam(description &#061; &#034;\u9879\u76ee\u8def\u5f84&#xff0c;\u5982\/home\/app\/myproject&#034;) String projectPath,<br \/>\n        &#064;ToolParam(description &#061; &#034;\u73af\u5883&#xff1a;dev\/test\/prod&#034;) String env,<br \/>\n        &#064;ToolParam(description &#061; &#034;\u662f\u5426\u8df3\u8fc7\u6d4b\u8bd5&#xff08;\u7d27\u6025\u4fee\u590d\u65f6\u53ef\u8df3\u8fc7&#xff09;&#034;) boolean skipTests) {<\/p>\n<p>    StringBuilder log &#061; new StringBuilder();<br \/>\n    String oldContainerId &#061; null;<\/p>\n<p>    try {<br \/>\n        \/\/ 1. \u7f16\u8bd1\u6253\u5305<br \/>\n        log.append(execCommand(projectPath,<br \/>\n            skipTests ? &#034;mvn clean package -DskipTests -q&#034; : &#034;mvn clean package -q&#034;));<\/p>\n<p>        \/\/ 2. \u5907\u4efd\u5f53\u524d\u8fd0\u884c\u7684\u5bb9\u5668ID<br \/>\n        oldContainerId &#061; execCommand(projectPath,<br \/>\n            &#034;docker ps -q &#8211;filter name&#061;myapp&#034;).trim();<\/p>\n<p>        \/\/ 3. \u6784\u5efa\u65b0\u955c\u50cf&#xff08;\u5e26\u7248\u672c\u6807\u7b7e&#xff0c;\u65b9\u4fbf\u56de\u6eda&#xff09;<br \/>\n        String version &#061; String.valueOf(System.currentTimeMillis());<br \/>\n        log.append(execCommand(projectPath,<br \/>\n            &#034;docker build -t myapp:&#034; &#043; version &#043; &#034; -t myapp:latest .&#034;));<\/p>\n<p>        \/\/ 4. \u505c\u65e7\u5bb9\u5668<br \/>\n        if (!oldContainerId.isEmpty()) {<br \/>\n            log.append(execCommand(projectPath, &#034;docker stop &#034; &#043; oldContainerId));<br \/>\n        }<\/p>\n<p>        \/\/ 5. \u542f\u52a8\u65b0\u5bb9\u5668<br \/>\n        log.append(execCommand(projectPath,<br \/>\n            &#034;docker compose up -d&#034;));<\/p>\n<p>        \/\/ 6. \u7b49\u5f85\u5065\u5eb7\u68c0\u67e5<br \/>\n        Thread.sleep(10000);<br \/>\n        String health &#061; execCommand(projectPath,<br \/>\n            &#034;docker inspect &#8211;format&#061;&#039;{{.State.Health.Status}}&#039; myapp&#034;).trim();<\/p>\n<p>        if (!&#034;healthy&#034;.equals(health)) {<br \/>\n            throw new RuntimeException(&#034;\u5065\u5eb7\u68c0\u67e5\u5931\u8d25&#xff0c;\u72b6\u6001&#xff1a;&#034; &#043; health);<br \/>\n        }<\/p>\n<p>        log.append(&#034;\u2705 \u90e8\u7f72\u6210\u529f&#xff01;\u65b0\u7248\u672c&#xff1a;&#034; &#043; version);<br \/>\n        log.append(&#034;\u2705 \u5065\u5eb7\u68c0\u67e5\u901a\u8fc7&#034;);<\/p>\n<p>        \/\/ 7. \u6e05\u7406\u65e7\u955c\u50cf&#xff08;\u4fdd\u7559\u6700\u8fd13\u4e2a\u7248\u672c&#xff09;<br \/>\n        execCommand(projectPath,<br \/>\n            &#034;docker images myapp &#8211;format &#039;{{.Tag}}&#039; | sort -r | tail -n &#043;4 | xargs -r docker rmi&#034;);<\/p>\n<p>        return log.toString();<\/p>\n<p>    } catch (Exception e) {<br \/>\n        log.append(&#034;\u274c \u90e8\u7f72\u5931\u8d25&#xff1a;&#034; &#043; e.getMessage());<\/p>\n<p>        \/\/ \u81ea\u52a8\u56de\u6eda<br \/>\n        if (oldContainerId !&#061; null &amp;&amp; !oldContainerId.isEmpty()) {<br \/>\n            log.append(&#034;\\\\n&#x1f504; \u6b63\u5728\u56de\u6eda\u5230\u4e0a\u4e00\u4e2a\u7248\u672c&#8230;&#034;);<br \/>\n            execCommand(projectPath, &#034;docker start &#034; &#043; oldContainerId);<br \/>\n            log.append(&#034;\u2705 \u5df2\u56de\u6eda&#034;);<br \/>\n        }<\/p>\n<p>        return log.toString();<br \/>\n    }<br \/>\n}<\/p>\n<p>&#064;Tool(description &#061; &#034;\u67e5\u770b\u670d\u52a1\u5668\u78c1\u76d8\u548c\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002&#034; &#043;<br \/>\n        &#034;Docker\u955c\u50cf\u548c\u5bb9\u5668\u65e5\u5fd7\u7ecf\u5e38\u5360\u6ee1\u78c1\u76d8&#xff0c;\u9700\u8981\u5b9a\u671f\u6e05\u7406\u3002&#034; &#043;<br \/>\n        &#034;\u78c1\u76d8\u4f7f\u7528\u7387\u8d85\u8fc780%\u65f6\u9700\u8981\u5173\u6ce8&#xff0c;\u8d85\u8fc790%\u9700\u8981\u7d27\u6025\u6e05\u7406&#034;)<br \/>\npublic String checkServerHealth() {<br \/>\n    StringBuilder report &#061; new StringBuilder(&#034;\u670d\u52a1\u5668\u5065\u5eb7\u62a5\u544a&#xff1a;\\\\n\\\\n&#034;);<\/p>\n<p>    \/\/ \u78c1\u76d8<br \/>\n    report.append(&#034;\u3010\u78c1\u76d8\u4f7f\u7528\u3011\\\\n&#034;);<br \/>\n    report.append(execCommand(null, &#034;df -h \/ \/var\/lib\/docker | tail -n &#043;2&#034;));<\/p>\n<p>    \/\/ \u5185\u5b58<br \/>\n    report.append(&#034;\\\\n\u3010\u5185\u5b58\u4f7f\u7528\u3011\\\\n&#034;);<br \/>\n    report.append(execCommand(null, &#034;free -h&#034;));<\/p>\n<p>    \/\/ Docker\u78c1\u76d8\u5360\u7528<br \/>\n    report.append(&#034;\\\\n\u3010Docker\u78c1\u76d8\u5360\u7528\u3011\\\\n&#034;);<br \/>\n    report.append(execCommand(null, &#034;docker system df&#034;));<\/p>\n<p>    return report.toString();<br \/>\n}<\/p>\n<p>&#064;Tool(description &#061; &#034;\u6e05\u7406Docker\u5783\u573e&#xff1a;\u672a\u4f7f\u7528\u7684\u955c\u50cf\u3001\u505c\u6b62\u7684\u5bb9\u5668\u3001\u60ac\u6302\u7684\u5377\u3001\u6784\u5efa\u7f13\u5b58\u3002&#034; &#043;<br \/>\n        &#034;\u5efa\u8bae\u6bcf\u5468\u6267\u884c\u4e00\u6b21&#xff0c;\u907f\u514d\u78c1\u76d8\u88ab\u5360\u6ee1\u3002&#034; &#043;<br \/>\n        &#034;\u6e05\u7406\u524d\u786e\u8ba4\u6ca1\u6709\u9700\u8981\u4fdd\u7559\u7684\u65e7\u7248\u672c&#034;)<br \/>\npublic String cleanDocker() {<br \/>\n    StringBuilder log &#061; new StringBuilder(&#034;Docker\u6e05\u7406\u62a5\u544a&#xff1a;\\\\n&#034;);<\/p>\n<p>    log.append(&#034;\u6e05\u7406\u524d&#xff1a;\\\\n&#034;);<br \/>\n    log.append(execCommand(null, &#034;docker system df&#034;));<\/p>\n<p>    log.append(&#034;\\\\n\u5f00\u59cb\u6e05\u7406&#8230;\\\\n&#034;);<br \/>\n    log.append(execCommand(null, &#034;docker system prune -f &#8211;volumes&#034;));<\/p>\n<p>    log.append(&#034;\\\\n\u6e05\u7406\u540e&#xff1a;\\\\n&#034;);<br \/>\n    log.append(execCommand(null, &#034;docker system df&#034;));<\/p>\n<p>    return log.toString();<br \/>\n}<\/p>\n<p>&#064;Tool(description &#061; &#034;\u67e5\u770b\u5e94\u7528\u5b9e\u65f6\u65e5\u5fd7\u3002\u652f\u6301\u8fc7\u6ee4\u5173\u952e\u8bcd&#xff08;\u5982ERROR\u3001WARN&#xff09;\u3002&#034; &#043;<br \/>\n        &#034;tailLines\u63a7\u5236\u8fd4\u56de\u6700\u8fd1\u591a\u5c11\u884c&#xff0c;\u907f\u514d\u65e5\u5fd7\u91cf\u8fc7\u5927&#034;)<br \/>\npublic String viewLogs(<br \/>\n        &#064;ToolParam(description &#061; &#034;\u8fc7\u6ee4\u5173\u952e\u8bcd&#xff0c;\u5982ERROR\/WARN\/Exception&#xff0c;\u7559\u7a7a\u67e5\u770b\u5168\u90e8&#034;)<br \/>\n        String keyword,<br \/>\n        &#064;ToolParam(description &#061; &#034;\u663e\u793a\u6700\u8fd1N\u884c&#xff0c;\u5efa\u8bae20-100&#034;) int tailLines) {<\/p>\n<p>    String cmd &#061; &#034;docker logs myapp &#8211;tail &#034; &#043; tailLines;<br \/>\n    if (keyword !&#061; null &amp;&amp; !keyword.isEmpty()) {<br \/>\n        cmd &#043;&#061; &#034; 2&gt;&amp;1 | grep -i &#034; &#043; keyword;<br \/>\n    }<\/p>\n<p>    return execCommand(null, cmd);<br \/>\n}<\/p>\n<p>&#064;Tool(description &#061; &#034;\u56de\u6eda\u5230\u6307\u5b9a\u7248\u672c\u3002version\u4e3adocker image\u7684tag\u3002&#034;)<br \/>\npublic String rollback(<br \/>\n        &#064;ToolParam(description &#061; &#034;\u76ee\u6807\u7248\u672c\u53f7&#xff08;image tag&#xff09;&#034;) String version) {<\/p>\n<p>    StringBuilder log &#061; new StringBuilder();<\/p>\n<p>    log.append(execCommand(null, &#034;docker stop myapp&#034;));<br \/>\n    log.append(execCommand(null, &#034;docker rm myapp&#034;));<br \/>\n    log.append(execCommand(null, &#034;docker run -d &#8211;name myapp -p 8080:8080 myapp:&#034; &#043; version));<\/p>\n<p>    return &#034;\u5df2\u56de\u6eda\u5230\u7248\u672c&#xff1a;&#034; &#043; version &#043; &#034;\\\\n&#034; &#043; log.toString();<br \/>\n}<\/p>\n<p>private String execCommand(String workingDir, String command) {<br \/>\n    try {<br \/>\n        ProcessBuilder pb &#061; new ProcessBuilder(&#034;\/bin\/bash&#034;, &#034;-c&#034;, command);<br \/>\n        if (workingDir !&#061; null) {<br \/>\n            pb.directory(new java.io.File(workingDir));<br \/>\n        }<br \/>\n        Process process &#061; pb.start();<\/p>\n<p>        String output &#061; new String(process.getInputStream().readAllBytes());<br \/>\n        String error &#061; new String(process.getErrorStream().readAllBytes());<\/p>\n<p>        process.waitFor(5, java.util.concurrent.TimeUnit.MINUTES);<\/p>\n<p>        return output &#043; (error.isEmpty() ? &#034;&#034; : &#034;\\\\n&#034; &#043; error);<br \/>\n    } catch (Exception e) {<br \/>\n        return &#034;\u547d\u4ee4\u6267\u884c\u5931\u8d25&#xff1a;&#034; &#043; e.getMessage();<br \/>\n    }<br \/>\n}<\/p>\n<p>} \u56db\u3001AI Agent\u7684\u90e8\u7f72\u5168\u6d41\u7a0b \u4f60\u53ea\u9700\u8981\u8bf4\u4e00\u53e5\u8bdd&#xff1a;\u201c\u5e2e\u6211\u628a\u9879\u76ee\u90e8\u7f72\u5230\u6d4b\u8bd5\u73af\u5883\u3002\u201d<\/p>\n<p>Agent\u81ea\u52a8\u6267\u884c&#xff1a;\u7f16\u8bd1\u6253\u5305&#xff08;\u8df3\u8fc7\u6d4b\u8bd5\u6216\u5168\u91cf\u8dd1\u53d6\u51b3\u4e8e\u73af\u5883&#xff09;\u3001\u6784\u5efaDocker\u955c\u50cf\u3001\u5907\u4efd\u5f53\u524d\u8fd0\u884c\u7248\u672c\u3001\u505c\u6b62\u65e7\u5bb9\u5668\u3001\u542f\u52a8\u65b0\u5bb9\u5668\u3001\u7b49\u5f85\u5065\u5eb7\u68c0\u67e5\u3001\u5065\u5eb7\u68c0\u67e5\u901a\u8fc7\u2192\u6e05\u7406\u65e7\u955c\u50cf\u3001\u5065\u5eb7\u68c0\u67e5\u5931\u8d25\u2192\u81ea\u52a8\u56de\u6eda\u3002<\/p>\n<p>\u6574\u4e2a\u8fc7\u7a0b\u4f60\u559d\u7740\u5496\u5561\u770b\u65e5\u5fd7\u5c31\u884c&#xff0c;\u51fa\u9519\u4e86\u8fd8\u80fd\u81ea\u52a8\u56de\u6eda\u3002<\/p>\n<p>\u4e94\u3001\u5b9a\u65f6\u5de1\u68c0 java &#064;Component public class ServerCronJob {<\/p>\n<p>&#064;Autowired<br \/>\nprivate DockerDeployTool deployTool;<\/p>\n<p>&#064;Scheduled(cron &#061; &#034;0 0 9 * * ?&#034;)  \/\/ \u6bcf\u5929\u65e9\u4e0a9\u70b9<br \/>\npublic void dailyHealthCheck() {<br \/>\n    String health &#061; deployTool.checkServerHealth();<\/p>\n<p>    \/\/ \u5982\u679c\u78c1\u76d8\u4f7f\u7528\u7387\u8d8580%&#xff0c;\u53d1\u544a\u8b66<br \/>\n    if (health.contains(&#034;80%&#034;) || health.contains(&#034;90%&#034;)) {<br \/>\n        sendAlert(&#034;\u670d\u52a1\u5668\u78c1\u76d8\u544a\u8b66&#034;, health);<br \/>\n    }<br \/>\n}<\/p>\n<p>&#064;Scheduled(cron &#061; &#034;0 0 3 ? * SUN&#034;)  \/\/ \u6bcf\u5468\u65e5\u51cc\u66683\u70b9<br \/>\npublic void weeklyCleanup() {<br \/>\n    deployTool.cleanDocker();<br \/>\n}<\/p>\n<p>} \u516d\u3001\u8e29\u5751\u8bb0\u5f55 \u57511&#xff1a;mvn package\u6162\u5f97\u79bb\u8c31\u3002 \u5c0f\u9879\u76ee\u8fd8\u597d&#xff0c;\u5927\u9879\u76ee\u4e00\u6b21\u6253\u5305\u4e24\u5206\u949f\u3002\u5982\u679c\u6bcf\u6b21\u90fd\u5168\u91cf\u6253\u5305&#xff0c;CI\/CD\u6d41\u6c34\u7ebf\u4f1a\u88ab\u62d6\u6162\u3002\u89e3\u51b3\u65b9\u6cd5&#xff1a;\u672c\u5730\u5f00\u53d1\u7528dev profile&#xff0c;\u8df3\u8fc7\u4e0d\u5fc5\u8981\u7684\u63d2\u4ef6\u3002<\/p>\n<p>\u57512&#xff1a;docker build\u7684\u5c42\u5c42\u7f13\u5b58\u3002 Dockerfile\u91ccCOPY\u547d\u4ee4\u987a\u5e8f\u9519\u4e86&#xff0c;\u6bcf\u6b21\u6539\u4ee3\u7801\u90fd\u4f1a\u8ba9\u6240\u6709\u5c42\u91cd\u5efa\u3002\u6b63\u786e\u987a\u5e8f&#xff1a;\u5148COPY pom.xml \u2192 RUN mvn dependency \u2192 \u518dCOPY src \u2192 RUN mvn package\u3002<\/p>\n<p>\u57513&#xff1a;\u5065\u5eb7\u68c0\u67e5\u7684start_period\u8bbe\u592a\u77ed\u3002 Spring Boot\u542f\u52a8\u5230\u5b8c\u5168\u5c31\u7eea\u53ef\u80fd\u9700\u898130-60\u79d2\u3002\u5982\u679cstart_period\u53ea\u8bbe10\u79d2&#xff0c;\u5bb9\u5668\u8fd8\u6ca1\u542f\u52a8\u5b8c\u5c31\u88ab\u5224\u5b9a\u4e3aunhealthy\u7136\u540e\u53c8\u88ab\u91cd\u542f&#xff0c;\u8fdb\u5165\u6b7b\u4ea1\u5faa\u73af\u3002<\/p>\n<p>yaml healthcheck: test: [\u201cCMD\u201d, \u201ccurl\u201d, \u201c-f\u201d, \u201chttp:\/\/localhost:8080\/actuator\/health\u201d] interval: 30s timeout: 5s retries: 5 start_period: 60s # \u2190 \u7ed9\u591f\u542f\u52a8\u65f6\u95f4&#xff01; \u4e03\u3001\u603b\u7ed3 \u8fd9\u5957\u65b9\u6848\u628a\u90e8\u7f72\u4ece&#034;\u624b\u52a820\u5206\u949f\u6613\u51fa\u9519&#034;\u53d8\u6210\u4e86&#034;\u4e00\u53e5\u8bdd\u6307\u4ee4\u81ea\u52a8\u5b8c\u6210\u8fd8\u5e26\u56de\u6eda&#034;\u3002\u4e09\u4e2a\u6838\u5fc3\u7ec4\u4ef6&#xff1a;Docker Tool\u5305\u88c5\u64cd\u4f5c\u547d\u4ee4\u3001\u5065\u5eb7\u68c0\u67e5\u786e\u4fdd\u65b0\u7248\u672c\u53ef\u7528\u3001\u81ea\u52a8\u56de\u6eda\u4fdd\u8bc1\u4e0d\u51fa\u751f\u4ea7\u4e8b\u6545\u3002<\/p>\n<p>\u9002\u5408\u6240\u6709\u7528Docker\u90e8\u7f72Spring Boot\u5e94\u7528\u7684\u56e2\u961f\u3002\u4e2a\u4eba\u5f00\u53d1\u8005\u7528\u8fd9\u5957\u4e5f\u80fd\u7701\u4e0b\u5927\u91cf\u8fd0\u7ef4\u65f6\u95f4\u2014\u2014\u628a\u7cbe\u529b\u653e\u5728\u5199\u4ee3\u7801\u4e0a&#xff0c;\u90e8\u7f72\u4ea4\u7ed9AI\u3002<\/p>\n<p>\u6709\u7528\u7684\u8bdd\u70b9\u8d5e\u6536\u85cf\u3002\u4e0b\u4e00\u7bc7\u300aAI Agent &#043; Elasticsearch&#xff1a;MCP\u534f\u8bae\u5b9e\u73b0\u667a\u80fd\u5168\u6587\u641c\u7d22\u300b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u90e8\u7f72\u5b9e\u6218\u3011Docker  AI Agent&#xff1a;\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668&#xff0c;\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 \u6587\u7ae0\u76ee\u5f55\u8bbe\u7f6e\u65f6\u533a\u521b\u5efa\u5e94\u7528\u76ee\u5f55\u590d\u5236jar\u5305\u521b\u5efa\u975eroot\u7528\u6237\u8fd0\u884c\u5065\u5eb7\u68c0\u67e5JVM\u53c2\u6570&#xff1a;\u9650\u5236\u5806\u5185\u5b58\u3001\u5f00\u542fGC\u65e5\u5fd7\u5199\u5728\u524d\u9762 \u5199\u8fc7Spring Boot\u7684\u90fd\u61c2\u2014\u2014\u5f00\u53d1\u4e00\u65f6\u723d&#xff0c;\u90e8\u7f72\u706b\u846c\u573a\u3002<br \/>\n\u6253\u5b8cjar\u5305\u5fd8\u4e86\u6539\u914d\u7f6e\u6587\u4ef6\u7684\u73af\u5883\u53d8\u91cf&#xff0c;\u4e0a\u53bb\u4e86\u8fde\u4e0d\u4e0a\u6570\u636e\u5e93\u3002\u6539\u4e86\u4ee3\u7801\u5fd8\u4e86\u66f4\u65b0Docker\u955c\u50cf&#xff0c;\u4e0a\u7ebf\u540e<\/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,98,50],"topic":[],"class_list":["post-86730","post","type-post","status-publish","format-standard","hentry","category-server","tag-docker","tag-spring-boot","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u90e8\u7f72\u5b9e\u6218\uff1bDocker + AI Agent\uff1a\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668\uff0c\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 - \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\/86730.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u90e8\u7f72\u5b9e\u6218\uff1bDocker + AI Agent\uff1a\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668\uff0c\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u3010\u90e8\u7f72\u5b9e\u6218\u3011Docker AI Agent&#xff1a;\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668&#xff0c;\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 \u6587\u7ae0\u76ee\u5f55\u8bbe\u7f6e\u65f6\u533a\u521b\u5efa\u5e94\u7528\u76ee\u5f55\u590d\u5236jar\u5305\u521b\u5efa\u975eroot\u7528\u6237\u8fd0\u884c\u5065\u5eb7\u68c0\u67e5JVM\u53c2\u6570&#xff1a;\u9650\u5236\u5806\u5185\u5b58\u3001\u5f00\u542fGC\u65e5\u5fd7\u5199\u5728\u524d\u9762 \u5199\u8fc7Spring Boot\u7684\u90fd\u61c2\u2014\u2014\u5f00\u53d1\u4e00\u65f6\u723d&#xff0c;\u90e8\u7f72\u706b\u846c\u573a\u3002 \u6253\u5b8cjar\u5305\u5fd8\u4e86\u6539\u914d\u7f6e\u6587\u4ef6\u7684\u73af\u5883\u53d8\u91cf&#xff0c;\u4e0a\u53bb\u4e86\u8fde\u4e0d\u4e0a\u6570\u636e\u5e93\u3002\u6539\u4e86\u4ee3\u7801\u5fd8\u4e86\u66f4\u65b0Docker\u955c\u50cf&#xff0c;\u4e0a\u7ebf\u540e\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/86730.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-28T23:00:28+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\/86730.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/86730.html\",\"name\":\"\u90e8\u7f72\u5b9e\u6218\uff1bDocker + AI Agent\uff1a\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668\uff0c\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-28T23:00:28+00:00\",\"dateModified\":\"2026-07-28T23:00:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/86730.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/86730.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86730.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u90e8\u7f72\u5b9e\u6218\uff1bDocker + AI Agent\uff1a\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668\uff0c\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4\"}]},{\"@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":"\u90e8\u7f72\u5b9e\u6218\uff1bDocker + AI Agent\uff1a\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668\uff0c\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 - \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\/86730.html","og_locale":"zh_CN","og_type":"article","og_title":"\u90e8\u7f72\u5b9e\u6218\uff1bDocker + AI Agent\uff1a\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668\uff0c\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u3010\u90e8\u7f72\u5b9e\u6218\u3011Docker AI Agent&#xff1a;\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668&#xff0c;\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 \u6587\u7ae0\u76ee\u5f55\u8bbe\u7f6e\u65f6\u533a\u521b\u5efa\u5e94\u7528\u76ee\u5f55\u590d\u5236jar\u5305\u521b\u5efa\u975eroot\u7528\u6237\u8fd0\u884c\u5065\u5eb7\u68c0\u67e5JVM\u53c2\u6570&#xff1a;\u9650\u5236\u5806\u5185\u5b58\u3001\u5f00\u542fGC\u65e5\u5fd7\u5199\u5728\u524d\u9762 \u5199\u8fc7Spring Boot\u7684\u90fd\u61c2\u2014\u2014\u5f00\u53d1\u4e00\u65f6\u723d&#xff0c;\u90e8\u7f72\u706b\u846c\u573a\u3002 \u6253\u5b8cjar\u5305\u5fd8\u4e86\u6539\u914d\u7f6e\u6587\u4ef6\u7684\u73af\u5883\u53d8\u91cf&#xff0c;\u4e0a\u53bb\u4e86\u8fde\u4e0d\u4e0a\u6570\u636e\u5e93\u3002\u6539\u4e86\u4ee3\u7801\u5fd8\u4e86\u66f4\u65b0Docker\u955c\u50cf&#xff0c;\u4e0a\u7ebf\u540e","og_url":"https:\/\/www.wsisp.com\/helps\/86730.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-28T23:00:28+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\/86730.html","url":"https:\/\/www.wsisp.com\/helps\/86730.html","name":"\u90e8\u7f72\u5b9e\u6218\uff1bDocker + AI Agent\uff1a\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668\uff0c\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-28T23:00:28+00:00","dateModified":"2026-07-28T23:00:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/86730.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/86730.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/86730.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u90e8\u7f72\u5b9e\u6218\uff1bDocker + AI Agent\uff1a\u8ba9AI\u4e00\u952e\u90e8\u7f72Spring Boot\u5230\u670d\u52a1\u5668\uff0c\u4ece\u6253\u5305\u5230\u4e0a\u7ebf\u53ea\u8981\u4e00\u6761\u6307\u4ee4"}]},{"@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\/86730","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=86730"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86730\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=86730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=86730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=86730"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=86730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}