4\u3001\u8fc1\u79fb\u6570\u636e\u5377<\/strong><\/div>\nDocker\u5bb9\u5668\u4e2d\u7684\u6570\u636e\u5377\u662f\u5171\u4eab\u76ee\u5f55\uff0c\u5176\u4e2d\u5305\u542b\u7279\u5b9a\u4e8e\u5bb9\u5668\u7684\u6570\u636e\u3002\u5377\u4e2d\u7684\u6570\u636e\u662f\u6301\u4e45\u7684\uff0c\u5728\u5bb9\u5668\u91cd\u65b0\u521b\u5efa\u671f\u95f4\u4e0d\u4f1a\u4e22\u5931\u3002<\/p>\n
\u4f7f\u7528\u5bfc\u51fa\u6216\u63d0\u4ea4\u5de5\u5177\u5c06Docker\u5bb9\u5668\u6216\u955c\u50cf\u4ece\u4e00\u53f0\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u65f6\uff0c\u4e0d\u4f1a\u8fc1\u79fb\u57fa\u7840\u6570\u636e\u5377\u3002<\/p>\n
\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5305\u542b\u6570\u636e\u7684\u76ee\u5f55\u5c06\u624b\u52a8\u8fc1\u79fb\u5230\u65b0\u670d\u52a1\u5668\u3002\u7136\u540e\u5728\u65b0\u670d\u52a1\u5668\u521b\u5efa\u5bb9\u5668\uff0c\u5f15\u7528\u8be5\u76ee\u5f55\u4f5c\u4e3a\u5176\u6570\u636e\u5377\u3002<\/p>\n
\u53e6\u4e00\u4e2a\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u5728\u201cdocker run\u201d\u547d\u4ee4\u4e2d\u4f20\u9012\u201c-volumes from\u201d\u53c2\u6570\u6765\u5907\u4efd\u548c\u6062\u590d\u6570\u636e\u5377\u3002<\/p>\n
\r\ndocker run --rm --volumes-from datavolume-name -v $(pwd):\/backup image-name tar cvf backup.tar \/path-to-datavolume \r\n<\/pre>\n\u8fd9\u91cc\uff0cdatavolume\u540d\u79f0\u662f\/path\/to\/volume\u3002\u6b64\u547d\u4ee4\u63d0\u4f9b\u6570\u636e\u5377\u7684\u5907\u4efd\u3002\u8981\u6307\u5b9a\u5de5\u4f5c\u76ee\u5f55\uff0c\u8fd8\u53ef\u4ee5\u6307\u5b9a-w\/backup\u3002\u5728\/backup\u6587\u4ef6\u5939\u4e2d\u751f\u6210\u7684\u5907\u4efd\u53ef\u4ee5\u901a\u8fc7scp\u6216ftp\u5de5\u5177\u590d\u5236\u5230\u65b0\u670d\u52a1\u5668\u3002\u7136\u540e\u63d0\u53d6\u590d\u5236\u7684\u5907\u4efd\u5e76\u5c06\u5176\u8fd8\u539f\u5230\u65b0\u5bb9\u5668\u4e2d\u7684\u6570\u636e\u5377\u4e2d\u3002<\/p>\n
\r\ndocker run --rm --volumes-from datavolume-name -v $(pwd):\/backup image-name bash -c \"cd \/path-to-datavolume && tar xvf \/backup\/backup.tar --strip 1\" \r\n<\/pre>\n5\u3001\u8fc1\u79fb\u6574\u4e2aDocker\u5bb9\u5668<\/strong><\/div>\n\u6211\u4eec\u5728\u8fd9\u91cc\u770b\u5230\u7684\u65b9\u6cd5\u9002\u7528\u4e8e\u5355\u4e2a\u5bb9\u5668\u3002\u4f46\u662f\u5c06\u6240\u6709\u5bb9\u5668\u90fd\u8981\u4ece\u4e00\u53f0\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u7684\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u91c7\u7528\u53e6\u4e00\u79cd\u65b9\u6cd5\u3002<\/p>\n
\u6b64\u65b9\u6cd5\u5305\u62ec\u5c06\u6574\u4e2adocker\u76ee\u5f55(\u201c\/var\/lib\/docker\u201d)\u590d\u5236\u5230\u65b0\u670d\u52a1\u5668\u3002\u4e3a\u4e86\u4f7f\u8fd9\u79cd\u65b9\u6cd5\u6210\u529f\uff0c\u9700\u8981\u786e\u5b9a\u51e0\u4e2a\u5173\u952e\u70b9\u3002<\/p>\n
\n\u4fdd\u7559\u6587\u4ef6\u5939\u7684\u6743\u9650\u548c\u6240\u6709\u6743\u3002
\n\u8fc1\u79fb\u524d\u505c\u6b62Docker\u670d\u52a1\u3002
\n\u9a8c\u8bc1\u4e24\u53f0\u670d\u52a1\u5668\u4e2d\u7684Docker\u7248\u672c\u662f\u5426\u517c\u5bb9\u3002
\n\u8fc1\u79fb\u524d\u540e\u9a8c\u8bc1\u5bb9\u5668\u5217\u8868\u548c\u529f\u80fd\u3002
\n\u73af\u5883\u53d8\u91cf\u548c\u5176\u4ed6\u914d\u7f6e\u6587\u4ef6\u7684\u8def\u5f84\u3002\n<\/ol>\n\u5982\u679c\u6b64\u65b9\u6cd5\u7531\u4e8e\u4efb\u4f55\u6545\u969c\u800c\u65e0\u6cd5\u5de5\u4f5c\uff0c\u6211\u4eec\u5c06\u914d\u7f6e\u81ea\u5b9a\u4e49\u811a\u672c\u4ee5\u5c06\u5bb9\u5668\u548c\u955c\u50cf\u4ece\u4e00\u53f0\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u3002<\/p>\n
\u7ed3\u8bba\uff1aDocker\u5bb9\u5668\u5e7f\u6cdb\u5e94\u7528\u4e8eDevOps\u548c\u57fa\u4e8eweb\u6258\u7ba1\u3002\u4eca\u5929\u6211\u4eec\u8ba8\u8bba\u4e86Docker\u5de5\u7a0b\u5e08\u5982\u4f55\u5c06Docker\u5bb9\u5668\u8fc1\u79fb\u5230\u6211\u4eec\u7ba1\u7406\u7684Docker\u57fa\u7840\u8bbe\u65bd\u4e2d\u7684\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u7684\u5404\u79cd\u65b9\u6cd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
Docker\u5bb9\u5668\u8fc1\u79fb\u901a\u5e38\u662f\u8fc1\u79fb\u4efb\u52a1\u7684\u4e00\u90e8\u5206\u3002\u4eca\u5929\u6211\u4eec\u5c06\u770b\u5230\u5c06Docker\u5bb9\u5668\u4ece\u73b0\u6709\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u7684\u4e0d […]<\/p>\n","protected":false},"author":370,"featured_media":116197,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-214024","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/214024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/370"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=214024"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/214024\/revisions"}],"predecessor-version":[{"id":214028,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/214024\/revisions\/214028"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/116197"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=214024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=214024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=214024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}