id: 93c065dbdf5c4bd890e453ad2ef42e4e
parent_id: 
item_type: 1
item_id: ddf3156b5f7f432f91c87dfc0681c98a
item_updated_time: 1764365025781
title_diff: "[{\"diffs\":[[1,\"极客神器：如何将 Docker 容器一键导出为 Docker Compose 文件？\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":42}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>极客神器：如何将 Docker 容器一键导出为 Docker Compose 文件？</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"content-class\\\" content=\\\"yinxiang.peso.superNote\\\"/>\\\r\\\n  <meta name=\\\"application-data:yinxiang.noteLayout\\\" content=\\\"{\\\"lineSpace\\\":\\\"recommend\\\",\\\"paragraphSpace\\\":\\\"recommend\\\"}\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"43474\\\"></a>\\\r\\\n<h1>极客神器：如何将 Docker 容器一键导出为 Docker Compose 文件？</h1>\\\r\\\n\\\r\\\n<div><span style=\\\"margin:0px;\\\"><div style=\\\"padding:8px 0px;margin:8px auto;max-width:700px;\\\"> <div><span></span></div>\\\n<p></p>\\\n<div style=\\\"--en-blockquote:true;box-sizing: border-box; padding-left: 19px; padding-top: 6px; padding-bottom: 6px; border-left: 3px solid #b4c0cc; background-position: initial initial; background-repeat: initial initial; margin-top: 6px\\\"><div>原文链接: <a href=\\\"http://mp.weixin.qq.com/s?__biz=MzI1NDAyNTM1MA==&amp;mid=2649413550&amp;idx=1&amp;sn=d9f0593aaab48f99b051d831022b614c&amp;chksm=f0638e0bca131b2e662a99621f1b2f4c55e85c6855cfb43c3a9d129dd6abd8fed7e28478afd8&amp;mpshare=1&amp;scene=1&amp;srcid=0526VdoBk4PQtsSkPWd2PONg&amp;sharer_shareinfo=52646252c5617a343e8bcb4665d3d63e&amp;sharer_shareinfo_first=52646252c5617a343e8bcb4665d3d63e#rd\\\"><span>http://mp.weixin.qq.com/s?__biz=MzI1NDAyNTM1MA==&amp;mid=2649413...</span></a></div></div>\\\n<p></p>\\\n<div><span></span></div>\\\n<div style=\\\"\\\"><div><div><h1 style=\\\"margin:0\\\"> 极客神器：如何将 Docker 容器一键导出为 Docker Compose 文件？ </h1><div><span style=\\\"position:relative\\\">原创</span><span> 军哥 </span><span><a style=\\\"position:relative\\\"> 军哥闲谝 </a></span><span><em></em></span></div><div style=\\\";\\\"><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:0;color:rgb(10,10,10);font-family:&quot;DejaVu Sans&quot;,&quot;Noto Sans CJK SC&quot;,&quot;WenQuanYi Zen Hei&quot;,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0;text-transform:none;widows:2;word-spacing:0;-webkit-text-stroke-width:0;white-space:normal;background-color:rgb(255,255,255);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;font-size:0;line-height:0\\\"><span> </span></p><div style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(10, 10, 10);font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;\\\"><h1 style=\\\"box-sizing:border-box;border-width:0 0 2px;border-style:solid;border-bottom-color:rgb(250,81,81);font-size:19.2px;font-weight:bold;margin:0 auto 1em;text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;display:table;padding:0 1em;color:rgb(63,63,63)\\\"><span>极客神器：如何将 Docker 容器一键导出为 Docker Compose 文件？</span></h1><blockquote style=\\\"box-sizing: border-box;border-width: 0px 0px 0px 4px;border-style: solid;border-left-color: rgb(250, 81, 81);margin: 0px 0px 1em;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;font-style: normal;padding: 1em;border-radius: 6px;color: rgba(0, 0, 0, 0.5);background: rgb(247, 247, 247);\\\"><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:0;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:1em;display:block;letter-spacing:0.1em;color:rgb(63,63,63)\\\"><span>在云计算和容器化技术盛行的今天，Docker 无疑是最炙手可热的容器化工具之一。无论是开发测试环境还是生产部署场景，我们常常需要在不同的服务器或 NAS 设备间迁移 Docker 容器配置。手动编写docker-compose.yaml文件不仅耗时费力，还容易因配置遗漏导致服务启动失败。有没有一种工具能自动将现有的 Docker 容器配置转化为标准的 Compose 文件？今天要介绍的docker2compose就是这样一款神器，它能帮你轻松实现从 Docker 容器到 Compose 文件的自动化转换，尤其适合 NAS 用户和多容器管理场景。</span></p></blockquote><h2 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:19.2px;font-weight:bold;margin:4em auto 2em;text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;display:table;padding:0 0.2em;color:rgb(255,255,255);background:rgb(250,81,81)\\\"><span>一、工具简介：为什么选择 docker2compose？</span></h2><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:1.5em 8px;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;letter-spacing:0.1em;color:rgb(63,63,63)\\\"><span>docker2compose是一个开源的 Docker Compose 文件生成工具，由 GitHub 用户coracoo开发。它的核心功能是读取 NAS 或服务器中已运行的 Docker 容器信息，自动分析容器间的网络关系，并根据规则生成对应的docker-compose.yaml文件。这款工具的设计初衷是解决极空间私有云用户的容器迁移痛点，但实际上兼容主流 NAS 系统和 Linux 服务器，甚至支持 ARM 架构设备（如树莓派）。</span></p><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>核心功能亮点</span></h3><ol style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:none;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>1. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>全量配置提取</span></strong><span>支持提取容器名称、镜像、端口映射、环境变量、数据卷挂载、网络配置、重启策略、特权模式、硬件设备挂载等 30 余项配置，几乎覆盖了 Docker 容器的所有关键参数（极空间不支持的性能限制、command 等功能除外）。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>2. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>智能分组管理</span></strong><span>通过分析容器间的自定义网络（Network）或 Link 连接关系，自动将相关容器划分为同一组，每组生成独立的 Compose 文件。例如，MySQL 与 WordPress 通过自定义网络连接，会被归为一组并生成wordpress-group.yaml。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>3. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>多场景适配</span></strong><pre style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-feature-settings: normal;font-variation-settings: normal;font-size: 14.4px;margin: 10px 8px;color: rgb(201, 209, 217);background: rgb(13, 17, 23);text-align: left;line-height: 1.5;overflow-x: auto;border-radius: 8px;padding: 0px !important;\\\"><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));display: flex;padding: 10px 14px 0px;\\\"><span><span></span><span></span><span></span></span></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>*   支持极空间 ZOS 系统（自动过滤不兼容配置）和 Debian 等主流系统；</span><span><br/></span><span>*   提供 Docker 部署和 Python 脚本直跑两种模式，适应不同技术栈用户；</span><span><br/></span><span>*   支持定时任务（CRON 表达式），可自动同步容器配置变更。</span></div></pre></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>4. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>标准化输出</span></strong><span>生成的 Compose 文件遵循 Docker Compose v3 规范，支持 Bridge、Host、Macvlan 等网络模式，并将自定义网络标记为external: true，确保迁移后网络配置的一致性。</span></div></li></ol><h2 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:19.2px;font-weight:bold;margin:4em auto 2em;text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;display:table;padding:0 0.2em;color:rgb(255,255,255);background:rgb(250,81,81)\\\"><span>二、快速上手：两种部署方式详解</span></h2><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>方式一：通过 Docker 容器部署（推荐）</span></h3><h4 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:16px;font-weight:bold;margin:2em 8px 0.5em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;color:rgb(250,81,81)\\\"><span>前提条件</span></h4><ul style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:circle;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• 目标设备已安装 Docker（建议版本≥20.10）；</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• 具备 Docker 命令行操作权限；</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• 预留至少 100MB 存储空间用于存放生成的 Compose 文件。</span></div></li></ul><h4 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:16px;font-weight:bold;margin:2em 8px 0.5em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;color:rgb(250,81,81)\\\"><span>部署命令（国内用户推荐阿里云镜像）</span></h4><pre style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-feature-settings: normal;font-variation-settings: normal;font-size: 14.4px;margin: 10px 8px;color: rgb(201, 209, 217);background: rgb(13, 17, 23);text-align: left;line-height: 1.5;overflow-x: auto;border-radius: 8px;padding: 0px !important;\\\"><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));display: flex;padding: 10px 14px 0px;\\\"><span><span></span><span></span><span></span></span></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>docker</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>run</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>-itd</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>--name</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>d2c</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>\\\\-v</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>/var/run/docker.sock:/var/run/docker.sock:ro</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>\\\\-v</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>/nas/compose:/app/compose</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(165, 214, 255);\\\"><span>\\\\</span></span><span> </span><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));color: rgb(139, 148, 158);\\\"><span># 替换为实际存储路径-e NAS=debian \\\\ # 系统类型，默认debian，极空间用户改为zos-e CRON=&quot;0 */12 * * *&quot; \\\\ # 定时任务，默认每12小时执行一次-e NETWORK=true \\\\ # 显式配置Bridge网络，默认true-e TZ=Asia/Shanghai \\\\ # 时区设置crpi-xg6dfmt5h2etc7hg.cn-hangzhou.personal.cr.aliyuncs.com/cherry4nas/d2c:latest </span></span></div></pre><h4 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:16px;font-weight:bold;margin:2em 8px 0.5em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;color:rgb(250,81,81)\\\"><span>参数说明</span></h4><ul style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:circle;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• -v /var/run/docker.sock:/var/run/docker.sock:ro挂载宿主机的 Docker 套接字，允许工具读取容器信息（需确保socket文件权限正确）。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• -v /nas/compose:/app/compose设置输出目录，工具会在该路径下创建以时间戳命名的子目录（如2023_10_01_14_30），存放生成的 Compose 文件。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• -e NAS=zos若使用极空间 ZOS 系统，必须指定此参数，工具会自动过滤 ZOS 不支持的配置（如 command、entrypoint）。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• -e CRON=&quot;once&quot;若只需执行一次导出任务，可将定时参数设为once，任务完成后容器自动退出。</span></div></li></ul><h4 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:16px;font-weight:bold;margin:2em 8px 0.5em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;color:rgb(250,81,81)\\\"><span>Docker Compose 部署方式</span></h4><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:1.5em 8px;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;letter-spacing:0.1em;color:rgb(63,63,63)\\\"><span>如果你更习惯使用 Compose 管理工具容器，可创建以下docker-compose.yaml文件：</span></p><pre style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-feature-settings: normal;font-variation-settings: normal;font-size: 14.4px;margin: 10px 8px;color: rgb(201, 209, 217);background: rgb(13, 17, 23);text-align: left;line-height: 1.5;overflow-x: auto;border-radius: 8px;padding: 0px !important;\\\"><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));display: flex;padding: 10px 14px 0px;\\\"><span><span></span><span></span><span></span></span></span><span></span><span></span><span></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>services:d2c:</span><span><br/></span><span>image: crpi-xg6dfmt5h2etc7hg.cn-hangzhou.personal.cr.aliyuncs.com/cherry4nas/d2c:latest # 国内镜像# </span><span><br/></span><span>image: ghcr.io/coracoo/d2c:latest # GitHub镜像（需科学上网）</span><span><br/></span><span>container_name: d2c</span><span><br/></span><span>volumes:</span><span><br/></span><span>- /var/run/docker.sock:/var/run/docker.sock:ro- /nas/compose:/app/composeenvironment:</span><span><br/></span><span>- NAS=debian- CRON=&quot;0 2 * * *&quot; # 每天凌晨2点执行一次</span><span><br/></span><span>- NETWORK=false</span><span><br/></span><span>- TZ=Asia/Shanghai</span><span><br/></span><span>restart: always # 建议设置为always，确保工具随系统启动 </span></div></pre><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:1.5em 8px;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;letter-spacing:0.1em;color:rgb(63,63,63)\\\"><span>保存后执行docker-compose up -d即可启动服务。</span></p><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>方式二：通过 Python 脚本直接运行</span></h3><h4 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:16px;font-weight:bold;margin:2em 8px 0.5em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;color:rgb(250,81,81)\\\"><span>前提条件</span></h4><ul style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:circle;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• 设备已安装 Python 3.8 + 和 Docker；</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• 安装pip包管理工具；</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• 下载工具源码（git clone https://github.com/coracoo/docker2compose.git）。</span></div></li></ul><h4 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:16px;font-weight:bold;margin:2em 8px 0.5em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;color:rgb(250,81,81)\\\"><span>操作步骤</span></h4><ol style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:none;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>1. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>赋予脚本执行权限</span></strong></div></li></ol><pre style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-feature-settings: normal;font-variation-settings: normal;font-size: 14.4px;margin: 10px 8px;color: rgb(201, 209, 217);background: rgb(13, 17, 23);text-align: left;line-height: 1.5;overflow-x: auto;border-radius: 8px;padding: 0px !important;\\\"><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));display: flex;padding: 10px 14px 0px;\\\"><span><span></span><span></span><span></span></span></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>cd docker2composechmod +x d2c.py run.sh</span></div></pre><ol style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:none;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>1. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>安装依赖包</span></strong></div></li></ol><pre style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-feature-settings: normal;font-variation-settings: normal;font-size: 14.4px;margin: 10px 8px;color: rgb(201, 209, 217);background: rgb(13, 17, 23);text-align: left;line-height: 1.5;overflow-x: auto;border-radius: 8px;padding: 0px !important;\\\"><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));display: flex;padding: 10px 14px 0px;\\\"><span><span></span><span></span><span></span></span></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>pip install -r requirements.txt </span></div></pre><ol style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:none;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>1. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>运行脚本</span></strong></div></li></ol><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:1.5em 8px;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;letter-spacing:0.1em;color:rgb(63,63,63)\\\"><code style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-feature-settings: normal;font-variation-settings: normal;font-size: 14.4px;text-align: left;line-height: 1.75;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;\\\"><span>./run.sh</span></code></p><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:1.5em 8px;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;letter-spacing:0.1em;color:rgb(63,63,63)\\\"><span>脚本会在当前目录下创建compose文件夹，按时间戳生成子目录和 Compose 文件。</span></p><h2 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:19.2px;font-weight:bold;margin:4em auto 2em;text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;display:table;padding:0 0.2em;color:rgb(255,255,255);background:rgb(250,81,81)\\\"><span>三、输出解析：如何理解生成的 Compose 文件？</span></h2><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>文件命名规则</span></h3><ul style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:circle;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>独立容器</span></strong><span>：单个无网络关联的容器生成{容器名}.yaml，例如容器名为nginx-web，则文件名为nginx-web.yaml。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>容器组</span></strong><span>：通过网络或 Link 关联的容器组生成{首个容器名前缀}-group.yaml，例如容器mysql-master和wordpress通过网络web-network连接，生成mysql-master-group.yaml。</span></div></li></ul><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>目录结构示例</span></h3><div style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));padding: 0px 8px;max-width: 100%;overflow: auto;\\\"><table style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: inherit;text-indent: 0px;border-collapse: collapse;border-spacing: 0px;\\\"><thead><tr style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));\\\"><td style=\\\"box-sizing: border-box;border: 1px solid rgb(223, 223, 223);text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);word-break: keep-all;\\\"><div><span>/compose└── 2023_10_01_14_30 # 时间戳目录├── nginx-web.yaml # 独立容器文件├── mysql-master-group.yaml # 容器组文件└── portainer.yaml # 另一个独立容器文件</span></div></td></tr></thead><tbody><tr><td><div><span><br/></span></div></td></tr></tbody></table></div><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>配置示例解析</span></h3><h2 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:19.2px;font-weight:bold;margin:4em auto 2em;text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;display:table;padding:0 0.2em;color:rgb(255,255,255);background:rgb(250,81,81)\\\"><span>四、进阶技巧：定制化配置与最佳实践</span></h2><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>环境变量深度应用</span></h3><ol style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:none;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>1. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>定时任务配置</span></strong><span>使用标准 CRON 表达式自定义执行时间，例如：</span><pre style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-feature-settings: normal;font-variation-settings: normal;font-size: 14.4px;margin: 10px 8px;color: rgb(201, 209, 217);background: rgb(13, 17, 23);text-align: left;line-height: 1.5;overflow-x: auto;border-radius: 8px;padding: 0px !important;\\\"><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));display: flex;padding: 10px 14px 0px;\\\"><span><span></span><span></span><span></span></span></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>*   0 0 \\\\* \\\\* \\\\*：每天凌晨 0 点执行；</span><span><br/></span><span>*   0 9,18 \\\\* \\\\* \\\\*：每天 9 点和 18 点各执行一次；</span><span><br/></span><span>*   0 \\\\*/6 \\\\* \\\\* \\\\*：每 6 小时执行一次。</span></div></pre></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>2. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>网络模式切换</span></strong><pre style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-feature-settings: normal;font-variation-settings: normal;font-size: 14.4px;margin: 10px 8px;color: rgb(201, 209, 217);background: rgb(13, 17, 23);text-align: left;line-height: 1.5;overflow-x: auto;border-radius: 8px;padding: 0px !important;\\\"><span style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));display: flex;padding: 10px 14px 0px;\\\"><span><span></span><span></span><span></span></span></span><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>*   NETWORK=true（默认）：显式声明 Bridge 网络，生成的 Compose 文件中每个服务单独配置network: bridge，适合需要保持原网络隔离性的场景。</span><span><br/></span><span>*   NETWORK=false：隐式使用 Compose 默认网络，工具会为每组容器创建新的网络（如{组名}\\\\_default），适合全新部署场景。</span></div></pre></div></li></ol><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>极空间 ZOS 系统适配</span></h3><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:1.5em 8px;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;letter-spacing:0.1em;color:rgb(63,63,63)\\\"><span>极空间用户需特别注意：</span></p><ul style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:circle;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• 必须设置NAS=zos环境变量，否则会生成 ZOS 不支持的command和entrypoint字段；</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• ZOS 对 Docker 的部分高级功能（如性能限制、自定义 Endpoint）支持有限，生成的 Compose 文件可能需要手动移除相关配置；</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• 建议通过极空间的 “Docker 管理” 界面先导出容器配置，再结合docker2compose生成的文件进行对比调整。</span></div></li></ul><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>迁移最佳实践</span></h3><ol style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:none;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>1. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>备份原容器</span></strong><span>在执行导出前，建议使用docker commit或 Volume 备份工具对重要容器数据进行快照，避免操作失误导致数据丢失。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>2. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>分组验证</span></strong><span>对复杂容器组（如包含 5 个以上容器的集群），建议先在测试环境中单独启动每组 Compose 文件，验证网络连通性和服务依赖关系。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>3. </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>版本管理</span></strong><span>将生成的 Compose 文件纳入版本控制（如 Git），配合时间戳目录可实现配置变更的追溯和回滚。</span></div></li></ol><h2 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:19.2px;font-weight:bold;margin:4em auto 2em;text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;display:table;padding:0 0.2em;color:rgb(255,255,255);background:rgb(250,81,81)\\\"><span>五、常见问题与解决方案</span></h2><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>Q1：工具运行后没有生成文件？</span></h3><ul style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:circle;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>检查权限</span></strong><span>：确保挂载的输出目录有写入权限，Docker 套接字文件/var/run/docker.sock的用户组权限正确（通常属于docker组）。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>确认容器存在</span></strong><span>：通过docker ps命令检查是否有正在运行的容器，工具仅处理up状态的容器。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>查看日志</span></strong><span>：通过docker logs d2c查看工具运行日志，常见错误包括镜像拉取失败、环境变量格式错误等。</span></div></li></ul><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>Q2：生成的 Compose 文件无法启动？</span></h3><ul style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:circle;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>手动调整配置</span></strong><span>：极个别场景下（如使用非标准网络驱动），工具可能无法正确解析配置，需手动修改networks或volumes字段。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>处理 Bridge 网络冲突</span></strong><span>：若原容器使用默认 Bridge 网络且未配置 Link，工具会将其分到不同组，可通过添加links或统一网络配置解决。</span></div></li></ul><h3 style=\\\"box-sizing:border-box;border-width:0 0 0 3px;border-style:solid;border-left-color:rgb(250,81,81);font-size:17.6px;font-weight:bold;margin:2em 8px 0.75em 0;text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;padding-left:8px;color:rgb(63,63,63)\\\"><span>Q3：如何更新工具版本？</span></h3><ul style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));list-style:circle;margin:0;padding:0 0 0 1em;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;color:rgb(63,63,63)\\\"><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>Docker 部署用户</span></strong><span>：执行docker pull crpi-xg6dfmt5h2etc7hg.cn-hangzhou.personal.cr.aliyuncs.com/cherry4nas/d2c:latest拉取最新镜像，然后重启容器。</span></div></li><li style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);\\\"><div><span>• </span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>源码用户</span></strong><span>：通过git pull更新仓库，重新安装依赖后重启脚本。</span></div></li></ul><h2 style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));font-size:19.2px;font-weight:bold;margin:4em auto 2em;text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;display:table;padding:0 0.2em;color:rgb(255,255,255);background:rgb(250,81,81)\\\"><span>六、总结：解放双手的容器管理革命</span></h2><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:1.5em 8px;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;letter-spacing:0.1em;color:rgb(63,63,63)\\\"><span>docker2compose的出现，让 Docker 容器的批量迁移和配置管理变得前所未有的简单。无论是 NAS 用户想备份容器配置，还是开发者需要快速复现测试环境，这款工具都能大幅提升效率。其智能分组、多系统适配和定时同步功能，更是让它成为容器化工作流中不可或缺的一环。如果你还在为手动编写 Compose 文件发愁，不妨试试这款神器，体验自动化带来的便捷吧！</span></p><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:1.5em 8px;text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei UI&quot;,&quot;Microsoft YaHei&quot;,Arial,sans-serif;font-size:16px;letter-spacing:0.1em;color:rgb(63,63,63)\\\"><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>项目地址</span></strong><span>：https://github.com/coracoo/docker2compose</span><span><br/></span><strong style=\\\"box-sizing: border-box;border-width: 0px;border-style: solid;border-color: hsl(var(--border));font-weight: bold;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;color: rgb(250, 81, 81);\\\"><span>官方文档</span></strong><span>：项目仓库内的README.md文件提供了更详细的配置说明和故障排查指南。</span></p></div><p style=\\\"box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--border));margin:0;color:rgb(10,10,10);font-family:&quot;DejaVu Sans&quot;,&quot;Noto Sans CJK SC&quot;,&quot;WenQuanYi Zen Hei&quot;,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0;text-transform:none;widows:2;word-spacing:0;-webkit-text-stroke-width:0;white-space:normal;background-color:rgb(255,255,255);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;font-size:0;line-height:0\\\"><span> </span></p><div><span><br/></span></div></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":71034}]"
metadata_diff: {"new":{"id":"ddf3156b5f7f432f91c87dfc0681c98a","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348865721,"user_updated_time":1764345635396,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":1764365025781},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:24:54.968Z
created_time: 2025-11-28T21:24:54.968Z
type_: 13