{"id":58650,"date":"2025-08-16T13:42:09","date_gmt":"2025-08-16T05:42:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/58650.html"},"modified":"2025-08-16T13:42:09","modified_gmt":"2025-08-16T05:42:09","slug":"%e8%af%a6%e8%a7%a3%ef%bc%9a%e6%b2%a1%e6%9c%89%e7%bd%91%e7%bb%9c%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%ef%bc%8c%e9%83%a8%e7%bd%b2%e8%87%aa%e5%b7%b1%e7%9a%84python%e9%a1%b9%e7%9b%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/58650.html","title":{"rendered":"\u8be6\u89e3\uff1a\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee"},"content":{"rendered":"<h2>\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a&#xff0c;\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee<\/h2>\n<p>\u56e0\u4e3a\u672c\u4eba\u641e\u4e86\u597d\u957f\u65f6\u95f4&#xff0c;\u7f51\u4e0a\u4e5f\u6ca1\u6709\u8be6\u7ec6\u7684\u6559\u7a0b&#xff0c;\u56e0\u6b64\u8bb0\u5f55\u5206\u4eab\u4e00\u4e0b\u3002<\/p>\n<h3>\u5728\u81ea\u5df1\u7535\u8111\u6784\u5efadocker\u9879\u76ee\u955c\u50cf<\/h3>\n<p>\u7f51\u7edc\u4e0a\u6709\u5f88\u591a\u5173\u4e8ewindows\u4e0b\u600e\u4e48\u5b89\u88c5docker\u7684\u6559\u7a0b&#xff0c;\u8fd9\u91cc\u5c31\u4e0d\u5728\u5199\u4e86&#xff0c;\u53ef\u4ee5\u5728csdn\u4e0a\u76f4\u63a5\u641cwindows\u4e0b\u5b89\u88c5docker\u7b49\u5173\u952e\u8bcd\u3002\u6ce8\u610f\u53ef\u4ee5\u6539\u4e00\u4e0b\u955c\u50cf\u4fdd\u5b58\u7684\u4f4d\u7f6e&#xff0c;\u8fd9\u4e2a\u5e94\u7528\u7684\u53f3\u4e0a\u89d2\u6709\u4e2a\u8bbe\u7f6e\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054123-68a01a03757b9.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<li>\u5b89\u88c5\u597d\u4e4b\u540e&#xff0c;\u9700\u8981\u542f\u52a8\u8fd9\u4e2a\u5e94\u7528\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054133-68a01a0d1be3d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u5982\u679c\u7f51\u4e0a\u6709\u4f60\u7684\u9879\u76ee\u9700\u8981\u7684\u955c\u50cf&#xff0c;\u4f60\u53ef\u4ee5\u73b0\u5c06\u955c\u50cf\u62c9\u53d6\u4e0b\u6765\u63a5\u7740&#xff0c;\u5728\u6784\u5efa\u81ea\u5df1\u7684\u9879\u76ee\u955c\u50cf\u3002<\/li>\n<p><span class=\"token function\">docker<\/span> pull \u955c\u50cf\u540d\u79f0<\/p>\n<p>\u62c9\u53d6\u4e0b\u6765\u4e4b\u540e&#xff0c;\u4f60\u7684\u5e94\u7528\u4e2d\u5e94\u8be5\u4f1a\u51fa\u73b0\u5bf9\u5e94\u7684\u955c\u50cf\u6587\u4ef6 3. \u4e4b\u540e\u53ef\u4ee5\u7528\u4f60\u81ea\u5df1\u51b3\u5b9a\u597d\u7528\u7684\u7f16\u7a0b\u8f6f\u4ef6\u6253\u5f00\u4f60\u81ea\u5df1\u7684\u9879\u76ee&#xff0c;\u5728\u9879\u76ee\u91cc\u9762\u6839\u636e\u81ea\u5df1\u9700\u8981\u7684\u4f9d\u8d56\u521b\u5efa\u5bf9\u5e94\u7684requirements.txt&#xff0c;\u7136\u540e\u521b\u5efa\u4e00Dockerfile <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054143-68a01a170e913.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> 4. \u7f16\u5199Dockerfile\u6587\u4ef6\u5185\u5bb9&#xff0c;\u5728\u8fd9\u91cc\u6211\u7684\u9879\u76ee\u9700\u8981cuda\u56e0\u6b64\u76f4\u63a5\u7f51\u4e0a\u627e\u522b\u4eba\u7684\u8fd9\u4e2a\u955c\u50cf\u62ff\u6765\u7528\u4e86&#xff0c;\u91cc\u9762\u5305\u542b\u4e86cuda\u548cpython\u7b49\u4f9d\u8d56\u3002<\/p>\n<p><span class=\"token comment\"># \u57fa\u7840\u955c\u50cf\u9009\u62e9Python\u7248\u672c<\/span><br \/>\nFROM pytorch<span class=\"token operator\">\/<\/span>pytorch<span class=\"token punctuation\">:<\/span><span class=\"token number\">2.7<\/span><span class=\"token number\">.0<\/span><span class=\"token operator\">&#8211;<\/span>cuda12<span class=\"token punctuation\">.<\/span><span class=\"token number\">6<\/span><span class=\"token operator\">&#8211;<\/span>cudnn9<span class=\"token operator\">&#8211;<\/span>devel<\/p>\n<p><span class=\"token comment\"># \u8bbe\u7f6e\u5de5\u4f5c\u76ee\u5f55<\/span><br \/>\nWORKDIR <span class=\"token operator\">\/<\/span>app<\/p>\n<p><span class=\"token comment\"># \u590d\u5236\u4f9d\u8d56\u6587\u4ef6\u5e76\u5b89\u88c5<\/span><br \/>\nCOPY requirements<span class=\"token punctuation\">.<\/span>txt <span class=\"token punctuation\">.<\/span><br \/>\nRUN pip install <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span>no<span class=\"token operator\">&#8211;<\/span>cache<span class=\"token operator\">&#8211;<\/span><span class=\"token builtin\">dir<\/span> <span class=\"token operator\">&#8211;<\/span>r requirements<span class=\"token punctuation\">.<\/span>txt <span class=\"token operator\">&#8211;<\/span>i https<span class=\"token punctuation\">:<\/span><span class=\"token operator\">\/\/<\/span>mirrors<span class=\"token punctuation\">.<\/span>aliyun<span class=\"token punctuation\">.<\/span>com<span class=\"token operator\">\/<\/span>pypi<span class=\"token operator\">\/<\/span>simple<span class=\"token operator\">\/<\/span><\/p>\n<p><span class=\"token comment\">#\u4fdd\u8bc1\u5bb9\u5668\u53ef\u4ee5\u5728\u542f\u52a8\u540e\u4e0d\u4e2d\u65ad<\/span><br \/>\nCMD <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;tail&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;-f&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\/dev\/null&#034;<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<li>\u7136\u540e\u5728\u8be5\u9879\u76ee\u6587\u4ef6\u8fd0\u884c&#xff0c;\u6ce8\u610f\u8fd9\u4e2a\u547d\u4ee4\u6700\u540e\u6709\u4e2a.<\/li>\n<p><span class=\"token function\">docker<\/span> build <span class=\"token parameter variable\">-t<\/span> \u4f60\u6784\u5efa\u7684\u955c\u50cf\u540d\u79f0 <span class=\"token builtin class-name\">.<\/span><\/p>\n<li>\u6784\u5efa\u5b8c\u6210\u4e4b\u540e&#xff0c;\u4f60\u53ef\u4ee5\u5728\u4f60\u7684\u5e94\u7528\u91cc\u770b\u5230\u4f60\u6784\u5efa\u5b8c\u6210\u7684docker\u955c\u50cf&#xff0c;\u4e4b\u540e\u56e0\u4e3a\u8981\u4e0a\u4f20\u7684\u670d\u52a1\u5668\u91cc&#xff0c;\u4f60\u9700\u8981\u5c06\u6587\u4ef6\u6253\u5305\u4e3atar\u6587\u4ef6&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u5728\u4f60\u7684\u9879\u76ee\u91cc\u6253\u5305&#xff0c;\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u540e\u53ef\u4ee5\u5220\u9664\u3002<\/li>\n<p><span class=\"token function\">docker<\/span> save <span class=\"token parameter variable\">-o<\/span> \u538b\u7f29\u5305\u540d\u5b57.tar \u8981\u6253\u5305\u7684\u955c\u50cf\u540d\u79f0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054144-68a01a180ad5d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>\u5728\u670d\u52a1\u5668\u4e0a\u90e8\u7f72docker\u9879\u76ee<\/h3>\n<li>\u56e0\u4e3a\u6211\u4f7f\u7528\u7684\u662fvscode\u8fde\u63a5\u670d\u52a1\u5668(\u4e0d\u77e5\u9053\u600e\u4e48\u8fde\u63a5\u670d\u52a1\u5668\u7684\u53ef\u4ee5\u53bb\u641c\u6559\u7a0b&#xff0c;\u7f51\u4e0a\u90fd\u6709\u5f88\u591a\u8be6\u7ec6\u7684\u6559\u7a0b)&#xff0c;\u56e0\u6b64\u6211\u90fd\u662f\u76f4\u63a5\u5c06\u6587\u4ef6\u62d6\u5230\u670d\u52a1\u5668\u91cc\u9762&#xff0c;\u5c31\u662f\u76f4\u63a5\u5c06\u4f60\u6253\u5305\u597d\u7684.tar\u6587\u4ef6\u62d6\u5230\u670d\u52a1\u5668\u4e2d\u5c31\u884c\u4e86\u3002<\/li>\n<p><span class=\"token comment\"># \u5728\u670d\u52a1\u5668\u4e0a\u52a0\u8f7d\u955c\u50cf<\/span><br \/>\n<span class=\"token function\">docker<\/span> load <span class=\"token parameter variable\">-i<\/span> \u538b\u7f29\u5305\u540d\u5b57.tar<\/p>\n<p>\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u4f60\u53ef\u4ee5\u770b\u5230\u4f60\u52a0\u8f7d\u7684\u955c\u50cf\u540d\u79f0&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> images<\/p>\n<p>\u5b8c\u6210\u4e4b\u540e\u4f60\u53ef\u4ee5\u5c06\u4f60\u4e4b\u524d\u6253\u5305\u597d\u7684.tar\u5220\u9664\u4e86\u3002<\/p>\n<li>\n<p>\u9879\u76ee\u6587\u4ef6\u5148\u4e0d\u653e\u5728docker\u5bb9\u5668\u4e2d&#xff0c;\u53ea\u653e\u4f9d\u8d56&#xff0c;\u901a\u8fc7\u6302\u8f7d\u5c06\u6587\u4ef6\u6302\u8f7d\u4e0a\u53bb\u3002\u4f60\u53ea\u9700\u8981\u5c06\u4f60\u7684\u9879\u76ee\u6587\u4ef6\u653e\u5230\u4f60\u670d\u52a1\u5668\u91cc\u9762\u5c31\u53ef\u4ee5\u4e86&#xff0c;\u5047\u5982\u5f53\u524d\u4f60\u7684\u9879\u76ee\u8def\u5f84\u4e3a&#xff1a;\/home\/test\/qwen_qlora_main <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054144-68a01a18d6f23.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<li>\n<p>\u6302\u8f7d\u65b9\u5f0f&#xff08;\u53ea\u6709\u5728docker run\u7684\u65f6\u5019\u9700\u8981\u6302\u8f7d&#xff0c;\u4e4b\u540edocker exec\u4e0d\u7528\u518d\u6267\u884c\u6302\u8f7d\u7684\u8fd9\u4e9b\u547d\u4ee4&#xff0c;\u8fd9\u4e9b\u5c5e\u6027\u5df2\u7ecf\u5728\u4f60\u7684docker\u5bb9\u5668\u4e2d\u4e86&#xff0c;\u5c31\u7b97\u505c\u6b62\u8fd9\u4e2a\u5bb9\u5668\u8fd8\u662f\u4e00\u76f4\u4fdd\u5b58\u6709\u7684&#xff0c;\u9664\u975e\u4f60\u628a\u5bb9\u5668\u5220\u9664\u4e86&#xff09;&#xff1a;<\/p>\n<\/li>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-it<\/span> <span class=\"token parameter variable\">&#8211;name<\/span> \u5bb9\u5668\u540d\u79f0&#xff08;\u81ea\u5df1\u547d\u540d&#xff09; <span class=\"token parameter variable\">&#8211;gpus<\/span> all <span class=\"token parameter variable\">&#8211;net<\/span><span class=\"token operator\">&#061;<\/span>host <span class=\"token parameter variable\">-v<\/span> \/home\/test\/qwen_qlora_main:\/app \u4f60\u7b2c1\u6b65\u52a0\u8f7d\u7684\u955c\u50cf\u540d\u79f0 \/bin\/bash<\/p>\n<li>\u5982\u679c\u955c\u50cf\u91cc\u9762\u5b58\u5728\u6587\u4ef6&#xff0c;\u5c31\u5c06\u90a3\u4e2a\u6587\u4ef6\u590d\u5236\u5230\u4f60\u8981\u6302\u8f7d\u7684\u6587\u4ef6\u91cc\u9762\u3002 \u590d\u5236\u5bb9\u5668\u5185\u6587\u4ef6\u5230\u672c\u5730&#xff0c;\u5c06\u955c\u50cf\u91cc\u9762\u7684\u90a3\u4e2a\u6587\u4ef6\u5220\u9664&#xff0c;\u8fd9\u6837\u65b9\u4fbf\u4f60\u7f16\u5199\u4ee3\u7801\u3002<\/li>\n<p><span class=\"token function\">docker<\/span> <span class=\"token function\">cp<\/span> <span class=\"token punctuation\">[<\/span>\u5bb9\u5668ID\u6216\u5bb9\u5668\u540d\u79f0<span class=\"token punctuation\">]<\/span>:<span class=\"token punctuation\">[<\/span>\u5bb9\u5668\u5185\u6587\u4ef6\u8def\u5f84<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span>\u672c\u5730\u76ee\u6807\u8def\u5f84<span class=\"token punctuation\">]<\/span><\/p>\n<li>\u56e0\u4e3a\u662fdocker run\u5b9e\u73b0\u7684\u5bb9\u5668&#xff0c;\u56e0\u6b64\u73b0\u5728\u4f60\u7684\u72b6\u6001\u662f\u5728\u5bb9\u5668\u91cc\u9762\u7684\u4e86&#xff0c;\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u8fd0\u884c\u4f60\u7684\u9879\u76ee\u4e86train_false_data_gen.py\u8fd9\u5c31\u662f\u4f60\u81ea\u5df1\u8981\u8dd1\u7684\u6587\u4ef6&#xff0c;evaluating\u5c31\u662f\u7b2c\u4e8c\u90e8\u56fe\u91cc\u9879\u76ee\u91cc\u7684\u6587\u4ef6\u5939&#xff0c;\u8fd9\u4e2atrain_false_data_gen.py\u6587\u4ef6\u5c31\u5728\u8fd9\u4e2a\u6587\u4ef6\u5bb6\u91cc\u9762&#xff0c;\u4e0b\u9762\u662f\u4f7f\u7528nohup\u542f\u52a8\u7684\u547d\u4ee4&#xff0c;\u5982\u679c\u4e0d\u7528nohup\u53ef\u4ee5\u53bb\u6389\/usr\/bin\/nohup\u548c&gt; test.log 2&gt;&amp;1 &amp;<\/li>\n<p><span class=\"token assign-left variable\">CUDA_VISIBLE_DEVICES<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span> \/usr\/bin\/nohup python evaluating\/train_false_data_gen.py <span class=\"token operator\">&gt;<\/span> test.log <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span> <span class=\"token operator\">&amp;<\/span><\/p>\n<h3>\u4e4b\u540e\u4f7f\u7528exec\u8fdb\u5165docker\u5bb9\u5668<\/h3>\n<li>\u5728\u4f60\u524d\u9762\u4f7f\u7528run\u521b\u5efa\u8fd0\u884c\u5e76\u8fdb\u5165docker\u5bb9\u5668\u540e&#xff0c;\u53ef\u4ee5\u4f7f\u7528ctrl&#043;p,\u7136\u540ectrl&#043;q\u4ece\u5bb9\u5668\u4e2d\u9000\u51fa\u800c\u4e0d\u505c\u6b62\u5bb9\u5668\u3002\u5982\u679c\u901a\u8fc7docekr run\u8fdb\u5165\u7684\u4f7f\u7528exit\u5c06\u4f1a\u505c\u6b62\u8be5\u5bb9\u5668\u5e76\u4e14\u9000\u51fa\u3002 \u5176\u4e2dctrl&#043;p,\u7136\u540ectrl&#043;q&#xff0c;\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fvscode\u8fde\u63a5\u7684\u670d\u52a1\u5668&#xff0c;\u4f60\u4f1a\u53d1\u73b0\u6267\u884c\u4e0d\u4e86&#xff0c;\u4f60\u9700\u8981\u5728vscode\u4e0b\u9762\u7684\u8bbe\u7f6e\u91cc\u9762\u641c\u7d22&#xff1a;terminal.Integrated.send \u5177\u4f53\u53ef\u4ee5\u53c2\u8003\u4e0b\u9762\u8fd9\u7bc7\u6587\u7ae0&#xff1a;<\/li>\n<p>VS Code \u4ece\u5bb9\u5668\u754c\u9762\u9000\u51fa\u4f46\u4fdd\u6301\u5bb9\u5668\u540e\u53f0\u8fd0\u884c<\/p>\n<li>\u5f53\u5728docker run\u4e4b\u540e\u4f7f\u7528exit&#xff0c;\u4f60\u4e0b\u6b21\u60f3\u8981\u8fdb\u5165docker\u5bb9\u5668\u9700\u8981<\/li>\n<p><span class=\"token function\">docker<\/span> start \u5bb9\u5668id<\/p>\n<p>\u4e4b\u540e<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> \u5bb9\u5668id \/bin\/bash<\/p>\n<li>\u5982\u679c\u662fdocker run\u4e4b\u540e\u4f7f\u7528ctrl&#043;p,\u7136\u540ectrl&#043;q\u4ece\u5bb9\u5668\u4e2d\u9000\u51fa&#xff0c;\u4f60\u53ea\u9700\u8981<\/li>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> \u5bb9\u5668id \/bin\/bash<\/p>\n<p>\u5373\u53ef\u8fdb\u5165\u5bb9\u5668 4. \u4f7f\u7528docker exec\u8fdb\u5165\u5bb9\u5668&#xff0c;\u4f60\u4f7f\u7528exit\u5c06\u4e0d\u4f1a\u505c\u6b62\u5bb9\u5668&#xff0c;\u800c\u4e14\u4f60\u53ef\u4ee5\u6b63\u5e38\u9000\u51fa\u5bb9\u5668\u3002<\/p>\n<h3>\u670d\u52a1\u5668\u5220\u9664docker<\/h3>\n<li>\u9996\u5148\u505c\u6b62\u4f60\u8981\u5220\u9664\u7684\u5bb9\u5668<\/li>\n<p><span class=\"token function\">docker<\/span> stop \u5bb9\u5668id<\/p>\n<li>\u4e4b\u540e\u5220\u9664\u8be5\u5bb9\u5668<\/li>\n<p><span class=\"token function\">docker<\/span> <span class=\"token function\">rm<\/span> \u5bb9\u5668id<\/p>\n<li>\u6700\u540e\u5220\u9664\u8be5\u955c\u50cf<\/li>\n<p><span class=\"token function\">docker<\/span> rmi \u955c\u50cfid<\/p>\n<h3>\u672c\u5730windows\u5220\u9664docker\u955c\u50cf\u548c\u5bb9\u5668<\/h3>\n<li>\n<p>\u56e0\u4e3a\u6211\u4eec\u672c\u5730\u7528docker\u53ea\u662f\u6784\u5efa\u7684\u9879\u76ee\u955c\u50cf&#xff0c;\u6ca1\u6709\u7275\u626f\u5230\u5bb9\u5668\u521b\u5efa&#xff0c;\u56e0\u6b64\u6211\u4eec\u53ea\u9700\u8981\u5220\u9664\u6211\u4eec\u521b\u5efa\u7684\u955c\u50cf\u5373\u53ef\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054145-68a01a19c98e3.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<li>\n<p>\u4e4b\u540e\u4ee5\u7ba1\u7406\u5458\u7684\u8eab\u4efd\u542f\u52a8\u547d\u4ee4\u63d0\u793a\u7b26&#xff0c;\u8f93\u5165diskpart <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054156-68a01a24d39a7.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<li>\n<p>\u627e\u5230\u4f60docker\u955c\u50cf\u5b58\u50a8\u7684\u4f4d\u7f6e&#xff0c;\u5c31\u5728\u6587\u7ae0\u5f00\u5934\u8bbe\u7f6e\u7684\u90a3\u4e00\u5757&#xff0c;\u6309\u7167\u6211\u6587\u7ae0\u5f00\u5934\u7684\u90a3\u4e2a\u4f4d\u7f6e&#xff0c;\u5177\u4f53\u8fd9\u4e2a\u955c\u50cf\u5b58\u50a8\u7684\u5730\u65b9\u4e3a&#xff1a;E:\\\\docker\\\\DockerDesktopWSL\\\\disk\\\\docker_data.vhdx\u3002 \u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4<\/p>\n<\/li>\n<p><span class=\"token keyword\">select<\/span> vdisk <span class=\"token assign-left variable\">file<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;E:\\\\docker\\\\DockerDesktopWSL\\\\disk\\\\docker_data.vhdx&#034;<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054201-68a01a29cac96.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> 4. \u622a\u6b62\u6267\u884c\u538b\u7f29\u547d\u4ee4&#xff1a;<\/p>\n<p>compact vdisk<\/p>\n<li>\u6700\u540e\u6267\u884c\u5220\u9664\u547d\u4ee4<\/li>\n<p>detach vdisk<\/p>\n<p>\u6267\u884c\u5b8c\u4e0a\u8ff0\u547d\u4ee4\u5728\u53bb\u67e5\u770b\u4f60\u5b58\u50a8\u8be5\u955c\u50cf\u7684\u78c1\u76d8&#xff0c;\u5185\u5b58\u5e94\u8be5\u662f\u91ca\u653e\u4e86\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb955\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf26\u6b21\u3002\u670d\u52a1\u5668\u6ca1\u6709\u7f51\u7edc\u7684\u60c5\u51b5\u4e0b\uff0c\u600e\u4e48\u5728\u672c\u5730\u6253\u5305\u597ddocker\u955c\u50cf\uff0c\u5e76\u5728\u670d\u52a1\u5668\u4e0a\u8fd0\u884cpython\u9879\u76ee<\/p>\n","protected":false},"author":2,"featured_media":58635,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81,149,43],"topic":[],"class_list":["post-58650","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-python","tag-windows","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8be6\u89e3\uff1a\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee - \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\/58650.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8be6\u89e3\uff1a\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb955\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf26\u6b21\u3002\u670d\u52a1\u5668\u6ca1\u6709\u7f51\u7edc\u7684\u60c5\u51b5\u4e0b\uff0c\u600e\u4e48\u5728\u672c\u5730\u6253\u5305\u597ddocker\u955c\u50cf\uff0c\u5e76\u5728\u670d\u52a1\u5668\u4e0a\u8fd0\u884cpython\u9879\u76ee\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/58650.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-16T05:42:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054123-68a01a03757b9.png\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58650.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/58650.html\",\"name\":\"\u8be6\u89e3\uff1a\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-16T05:42:09+00:00\",\"dateModified\":\"2025-08-16T05:42:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/58650.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/58650.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58650.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8be6\u89e3\uff1a\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee\"}]},{\"@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":"\u8be6\u89e3\uff1a\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee - \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\/58650.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8be6\u89e3\uff1a\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb955\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf26\u6b21\u3002\u670d\u52a1\u5668\u6ca1\u6709\u7f51\u7edc\u7684\u60c5\u51b5\u4e0b\uff0c\u600e\u4e48\u5728\u672c\u5730\u6253\u5305\u597ddocker\u955c\u50cf\uff0c\u5e76\u5728\u670d\u52a1\u5668\u4e0a\u8fd0\u884cpython\u9879\u76ee","og_url":"https:\/\/www.wsisp.com\/helps\/58650.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-16T05:42:09+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816054123-68a01a03757b9.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/58650.html","url":"https:\/\/www.wsisp.com\/helps\/58650.html","name":"\u8be6\u89e3\uff1a\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-16T05:42:09+00:00","dateModified":"2025-08-16T05:42:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/58650.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/58650.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/58650.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8be6\u89e3\uff1a\u6ca1\u6709\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u90e8\u7f72\u81ea\u5df1\u7684python\u9879\u76ee"}]},{"@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\/58650","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=58650"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/58650\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/58635"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=58650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=58650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=58650"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=58650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}