{"id":17943,"date":"2024-11-18T11:30:12","date_gmt":"2024-11-18T03:30:12","guid":{"rendered":"https:\/\/fwq.ai\/blog\/17943\/"},"modified":"2024-11-18T11:30:12","modified_gmt":"2024-11-18T03:30:12","slug":"docker%e4%b8%8b%e8%bd%bd%e7%9a%84%e9%95%9c%e5%83%8f%e6%94%be%e5%93%aa%e4%b8%aa%e6%96%87%e4%bb%b6%e5%a4%b9","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/17943\/","title":{"rendered":"docker\u4e0b\u8f7d\u7684\u955c\u50cf\u653e\u54ea\u4e2a\u6587\u4ef6\u5939"},"content":{"rendered":"<blockquote><p>\n  docker \u955c\u50cf\u9ed8\u8ba4\u5b58\u50a8\u5728 \/var\/lib\/docker\/image \u6587\u4ef6\u5939\u3002docker \u4ee5\u5206\u5c42\u65b9\u5f0f\u5b58\u50a8\u955c\u50cf\uff1a\u5f53\u65b0\u7684\u955c\u50cf\u4e0b\u8f7d\u65f6\uff0cdocker \u4f1a\u68c0\u67e5\u5b83\u662f\u5426\u5df2\u7ecf\u5b58\u5728\u4e8e\u672c\u5730\u5b58\u50a8\u4e2d\u3002\u5982\u679c\u4e0d\u5b58\u5728\uff0cdocker \u4f1a\u4ece\u4ed3\u5e93\u4e2d\u4e0b\u8f7d\u955c\u50cf\u5e76\u5b58\u50a8\u5728 image \u6587\u4ef6\u5939\u4e2d\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e docker-root \u6807\u5fd7\u6765\u66f4\u6539\u5b58\u50a8\u4f4d\u7f6e\u3002docker \u8fd8\u63d0\u4f9b\u5176\u4ed6\u5b58\u50a8\u9009\u9879\uff0c\u5982\u5206\u5e03\u5f0f\u5b58\u50a8\u3001\u8fdc\u7a0b\u5b58\u50a8\u548c\u81ea\u5b9a\u4e49\u5b58\u50a8\u9a71\u52a8\u7a0b\u5e8f\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/07\/2024040719061848841.jpg\" class=\"aligncenter\" title=\"docker\u4e0b\u8f7d\u7684\u955c\u50cf\u653e\u54ea\u4e2a\u6587\u4ef6\u5939\u63d2\u56fe\" alt=\"docker\u4e0b\u8f7d\u7684\u955c\u50cf\u653e\u54ea\u4e2a\u6587\u4ef6\u5939\u63d2\u56fe\" \/><\/p>\n<p><strong>Docker \u955c\u50cf\u7684\u5b58\u50a8\u4f4d\u7f6e<\/strong><\/p>\n<p>Docker \u4e0b\u8f7d\u7684\u955c\u50cf\u9ed8\u8ba4\u5b58\u50a8\u5728\u4ee5\u4e0b\u6587\u4ef6\u5939\uff1a<\/p>\n<pre>\/var\/lib\/docker\/image<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u5939\u4f4d\u4e8e Docker \u5b89\u88c5\u76ee\u5f55\u4e2d\uff0c\u5e76\u4e14\u5305\u542b\u4e0b\u8f7d\u7684\u6240\u6709\u955c\u50cf\u3002\u6bcf\u4e2a\u955c\u50cf\u90fd\u88ab\u5b58\u50a8\u5728\u4e00\u4e2a\u5355\u72ec\u7684\u5b50\u6587\u4ef6\u5939\u4e2d\uff0c\u5176\u4e2d\u5305\u542b\u955c\u50cf\u7684\u5143\u6570\u636e\u548c\u5c42\u6587\u4ef6\u3002<\/p>\n<p><strong>\u955c\u50cf\u5b58\u50a8\u673a\u5236<\/strong><\/p>\n<p>Docker \u4ee5\u5206\u5c42\u7684\u65b9\u5f0f\u5b58\u50a8\u955c\u50cf\uff0c\u8fd9\u610f\u5473\u7740\u6bcf\u4e2a\u65b0\u955c\u50cf\u90fd\u662f\u57fa\u4e8e\u4e00\u4e2a\u6216\u591a\u4e2a\u73b0\u6709\u955c\u50cf\u6784\u5efa\u7684\u3002\u5f53\u4e00\u4e2a\u65b0\u7684\u955c\u50cf\u88ab\u4e0b\u8f7d\u65f6\uff0cDocker \u9996\u5148\u68c0\u67e5\u5b83\u662f\u5426\u5df2\u7ecf\u5b58\u5728\u4e8e\u672c\u5730\u5b58\u50a8\u4e2d\u3002\u5982\u679c\u5b58\u5728\uff0c\u5219\u65e0\u9700\u518d\u6b21\u4e0b\u8f7d\u3002\u5426\u5219\uff0cDocker \u5c06\u4ece\u955c\u50cf\u4ed3\u5e93\u4e0b\u8f7d\u955c\u50cf\u5e76\u5c06\u5176\u5b58\u50a8\u5728 image \u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<p><strong>\u66f4\u6539\u9ed8\u8ba4\u5b58\u50a8\u4f4d\u7f6e<\/strong><\/p>\n<p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5c06\u955c\u50cf\u5b58\u50a8\u5728\u5176\u4ed6\u4f4d\u7f6e\uff0c\u4f8b\u5982\u4e3a\u4e86\u63d0\u9ad8\u6027\u80fd\u6216\u8282\u7701\u7a7a\u95f4\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e -root \u6807\u5fd7\u6765\u66f4\u6539\u9ed8\u8ba4\u5b58\u50a8\u4f4d\u7f6e\uff1a<\/p>\n<pre>sudo dockerd --gpus all --storage-driver overlay2 --docker-root \/path\/to\/new\/storage\/location<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6ce8\u610f\uff0c\u91cd\u65b0\u542f\u52a8 Docker \u670d\u52a1\u540e\uff0c\u6b64\u66f4\u6539\u624d\u80fd\u751f\u6548\u3002<\/p>\n<p><strong>\u5176\u4ed6\u5b58\u50a8\u9009\u9879<\/strong><\/p>\n<p>\u9664\u4e86\u9ed8\u8ba4\u5b58\u50a8\u4f4d\u7f6e\u5916\uff0cDocker \u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u5b58\u50a8\u9009\u9879\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li> <strong>\u5206\u5e03\u5f0f\u5b58\u50a8\uff1a<\/strong> \u5c06\u955c\u50cf\u5b58\u50a8\u5728\u591a\u4e2a\u8282\u70b9\u4e0a\uff0c\u4ee5\u63d0\u9ad8\u53ef\u7528\u6027\u548c\u6027\u80fd\u3002<\/li>\n<li> <strong>\u8fdc\u7a0b\u5b58\u50a8\uff1a<\/strong> \u5c06\u955c\u50cf\u5b58\u50a8\u5728\u4e91\u5b58\u50a8\u670d\u52a1\uff08\u5982 Amazon S3 \u6216 Google Cloud Storage\uff09\u4e2d\uff0c\u4ee5\u8282\u7701\u672c\u5730\u5b58\u50a8\u7a7a\u95f4\u3002<\/li>\n<li> <strong>\u81ea\u5b9a\u4e49\u5b58\u50a8\u9a71\u52a8\u7a0b\u5e8f\uff1a<\/strong> \u521b\u5efa\u81ea\u5b9a\u4e49\u5b58\u50a8\u9a71\u52a8\u7a0b\u5e8f\uff0c\u4ee5\u6ee1\u8db3\u7279\u5b9a\u9700\u6c42\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u5728\u81ea\u5df1\u7684 NAS \u8bbe\u5907\u4e0a\u5b58\u50a8\u955c\u50cf\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4e0b\u8f7d\u7684\u955c\u50cf\u653e\u54ea\u4e2a\u6587\u4ef6\u5939\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>docker \u955c\u50cf\u9ed8\u8ba4\u5b58\u50a8\u5728 \/var\/lib\/docker\/image \u6587\u4ef6\u5939\u3002docker \u4ee5\u5206\u5c42\u65b9\u5f0f\u5b58\u50a8\u955c\u50cf\uff1a\u5f53\u65b0\u7684\u955c\u50cf\u4e0b\u8f7d\u65f6\uff0cdocker \u4f1a\u68c0\u67e5\u5b83\u662f\u5426\u5df2\u7ecf\u5b58\u5728\u4e8e\u672c\u5730\u5b58\u50a8\u4e2d\u3002\u5982\u679c\u4e0d\u5b58\u5728\uff0cdocker \u4f1a\u4ece\u4ed3\u5e93\u4e2d\u4e0b\u8f7d\u955c\u50cf\u5e76\u5b58\u50a8\u5728 image \u6587\u4ef6\u5939\u4e2d\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e docker-root \u6807\u5fd7\u6765\u66f4\u6539\u5b58\u50a8\u4f4d\u7f6e\u3002docker \u8fd8\u63d0\u4f9b\u5176\u4ed6\u5b58\u50a8\u9009\u9879\uff0c\u5982\u5206\u5e03\u5f0f\u5b58\u50a8\u3001\u8fdc\u7a0b\u5b58\u50a8\u548c\u81ea\u5b9a\u4e49\u5b58\u50a8\u9a71\u52a8\u7a0b\u5e8f\u3002 Docker \u955c\u50cf\u7684\u5b58\u50a8\u4f4d\u7f6e Docker \u4e0b\u8f7d\u7684\u955c\u50cf\u9ed8\u8ba4\u5b58\u50a8\u5728\u4ee5\u4e0b\u6587\u4ef6\u5939\uff1a \/var\/lib\/docker\/image \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u4e2a\u6587\u4ef6\u5939\u4f4d\u4e8e Docker \u5b89\u88c5\u76ee\u5f55\u4e2d\uff0c\u5e76\u4e14\u5305\u542b\u4e0b\u8f7d\u7684\u6240\u6709\u955c\u50cf\u3002\u6bcf\u4e2a\u955c\u50cf\u90fd\u88ab\u5b58\u50a8\u5728\u4e00\u4e2a\u5355\u72ec\u7684\u5b50\u6587\u4ef6\u5939\u4e2d\uff0c\u5176\u4e2d\u5305\u542b\u955c\u50cf\u7684\u5143\u6570\u636e\u548c\u5c42\u6587\u4ef6\u3002 \u955c\u50cf\u5b58\u50a8\u673a\u5236 Docker \u4ee5\u5206\u5c42\u7684\u65b9\u5f0f\u5b58\u50a8\u955c\u50cf\uff0c\u8fd9\u610f\u5473\u7740\u6bcf\u4e2a\u65b0\u955c\u50cf\u90fd\u662f\u57fa\u4e8e\u4e00\u4e2a\u6216\u591a\u4e2a\u73b0\u6709\u955c\u50cf\u6784\u5efa\u7684\u3002\u5f53\u4e00\u4e2a\u65b0\u7684\u955c\u50cf\u88ab\u4e0b\u8f7d\u65f6\uff0cDocker \u9996\u5148\u68c0\u67e5\u5b83\u662f\u5426\u5df2\u7ecf\u5b58\u5728\u4e8e\u672c\u5730\u5b58\u50a8\u4e2d\u3002\u5982\u679c\u5b58\u5728\uff0c\u5219\u65e0\u9700\u518d\u6b21\u4e0b\u8f7d\u3002\u5426\u5219\uff0cDocker \u5c06\u4ece\u955c\u50cf\u4ed3\u5e93\u4e0b\u8f7d\u955c\u50cf\u5e76\u5c06\u5176\u5b58\u50a8\u5728 image \u6587\u4ef6\u5939\u4e2d\u3002 \u66f4\u6539\u9ed8\u8ba4\u5b58\u50a8\u4f4d\u7f6e \u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5c06\u955c\u50cf\u5b58\u50a8\u5728\u5176\u4ed6\u4f4d\u7f6e\uff0c\u4f8b\u5982\u4e3a\u4e86\u63d0\u9ad8\u6027\u80fd\u6216\u8282\u7701\u7a7a\u95f4\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e -root \u6807\u5fd7\u6765\u66f4\u6539\u9ed8\u8ba4\u5b58\u50a8\u4f4d\u7f6e\uff1a sudo dockerd &#8211;gpus all &#8211;storage-driver overlay2 &#8211;docker-root \/path\/to\/new\/storage\/location \u767b\u5f55\u540e\u590d\u5236 \u6ce8\u610f\uff0c\u91cd\u65b0\u542f\u52a8 Docker \u670d\u52a1\u540e\uff0c\u6b64\u66f4\u6539\u624d\u80fd\u751f\u6548\u3002 \u5176\u4ed6\u5b58\u50a8\u9009\u9879 \u9664\u4e86\u9ed8\u8ba4\u5b58\u50a8\u4f4d\u7f6e\u5916\uff0cDocker \u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u5b58\u50a8\u9009\u9879\uff0c\u5305\u62ec\uff1a \u5206\u5e03\u5f0f\u5b58\u50a8\uff1a \u5c06\u955c\u50cf\u5b58\u50a8\u5728\u591a\u4e2a\u8282\u70b9\u4e0a\uff0c\u4ee5\u63d0\u9ad8\u53ef\u7528\u6027\u548c\u6027\u80fd\u3002 \u8fdc\u7a0b\u5b58\u50a8\uff1a \u5c06\u955c\u50cf\u5b58\u50a8\u5728\u4e91\u5b58\u50a8\u670d\u52a1\uff08\u5982 Amazon S3 \u6216 Google [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-17943","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=17943"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17943\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=17943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=17943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=17943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}