\u6570\u636e\u5377\u5bb9\u5668<\/strong><\/div>\n\u5efa\u7acb\u7684\u5bb9\u5668\u5f88\u591a\u65f6\u5019\u4e0d\u662f\u5355\u4e00\u7684\uff0c\u9700\u8981\u5bb9\u5668\u4e4b\u95f4\u8fdb\u884c\u6570\u636e\u5171\u4eab\uff0c\u8fdb\u884c\u6570\u636e\u540c\u6b65\u548c\u66f4\u65b0\u64cd\u4f5c\u3002\u8fd9\u6837\u5c31\u9700\u8981\u5efa\u7acb\u4e00\u4e2a\u6570\u636e\u5377\u5bb9\u5668\u3002<\/p>\n
\u6570\u636e\u5377\u5bb9\u5668\u5c31\u662f\u4e00\u4e2a\u666e\u901a\u7684\u5bb9\u5668\uff0c\u91cc\u8fb9\u5e26\u6709\u8bbe\u7f6e\u597d\u7684\u6570\u636e\u5377\uff0c\u4e13\u95e8\u63d0\u4f9b\u7ed9\u5176\u4ed6\u5bb9\u5668\u6302\u8f7d\u4f7f\u7528\u3002 \u901a\u8fc7\u2013volumes-from \u6570\u636e\u5377\u5bb9\u5668\u540d \u6765\u5b9e\u73b0\u3002<\/p>\n
\u6211\u6709\u4e00\u4e2a\u7f51\u7ad9\u7a0b\u5e8f\u653e\u5230\u4e86\u670d\u52a1\u5668\u672c\u673a\u7684\/home\/webdata\u76ee\u5f55 \uff0c\u4e0b\u8fb9\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5377\u5bb9\u5668webdata\uff0c\u540c\u65f6\u5c06\u6211\u670d\u52a1\u5668\u4e0a\u7684\/home\/webdata\u6302\u8f7d\u5230\u6570\u636e\u5377\u5bb9\u5668\u7684\/web\u76ee\u5f55\uff1a<\/p>\n
\r\n[root@docker5 home]# docker run -d -ti --name webdata -v \/home\/webdata:\/home\/web centos\r\n<\/pre>\n\u8fdb\u5165\u5bb9\u5668\u5e76\u67e5\u770b\u6570\u636e<\/p>\n
\r\n[root@docker5 home]# docker exec -ti webdata \/bin\/bash\r\n[root@289598d6e24d \/]# cd \/home\/web\/\r\n[root@289598d6e24d web]# ll\r\ntotal 7872\r\ndrwxr-xr-x. 3 root root 54 Mar 27 2013 META-INF\r\ndrwxr-xr-x. 6 root root 4096 Dec 25 2014 WEB-INF\r\ndrwxr-xr-x. 3 root root 63 Mar 27 2013 css\r\ndrwxr-xr-x. 2 root root 8192 Mar 27 2013 flags\r\n-rw-r--r--. 1 root root 97 Mar 27 2013 index.jsp\r\ndrwxr-xr-x. 2 root root 4096 Mar 27 2013 js\r\ndrwxr-xr-x. 2 root root 6 Jun 23 03:43 probe\r\n<\/pre>\n\u901a\u8fc7\u8fd9\u91cc\u5efa\u7acb1.txt \u5e76\u63d2\u5165\u5185\u5bb9\uff0c\u53ef\u4ee5\u770b\u5230\u670d\u52a1\u5668\u4e0a\u7684\/home\/webdata\u6570\u636e\u662f\u540c\u6b65\u7684\u3002\u53ef\u89c1\u5bb9\u5668\u4ee5\u53ca\u76ee\u5f55\u6302\u8f7d\u90fd\u6ca1\u95ee\u9898\u3002<\/p>\n
\r\n[root@docker5 home]# docker run -dti --volumes-from webdata --name os147 centos\r\n[root@docker5 home]# docker run -dti --volumes-from webdata --name os258 centos\r\n<\/pre>\n\u5206\u522b\u521b\u5efa\u4e86\u4e24\u4e2a\u5bb9\u5668\uff0c\u90fd\u901a\u8fc7\u2013volumes-from webdata \u6302\u8f7d\u4e86\u540c\u4e00\u4e2a\u6570\u636e\u5377\u5bb9\u5668\uff0c\u8fdb\u5165os147 \u548cos258 \u5206\u522b\u67e5\u770b\/home\/web\u53ef\u89c1\u6570\u636e\u90fd\u662f\u5b58\u5728\u7684\uff0c\u4e8e\u662f\u8fd9\u91cc\u5c31\u5b9e\u73b0\u4e86\u6570\u636e\u7684\u5171\u4eab\u540c\u6b65\u3002<\/p>\n
\r\n[root@docker5 home]# docker exec -ti os147 \/bin\/bash\r\n[root@b4cfa4c4e11c \/]# cd \/home\/web\/\r\n[root@b4cfa4c4e11c web]# ll\r\ntotal 7876\r\n-rw-r--r--. 1 root root 11 Jun 23 03:46 1.txt\r\ndrwxr-xr-x. 3 root root 54 Mar 27 2013 META-INF\r\ndrwxr-xr-x. 6 root root 4096 Dec 25 2014 WEB-INF\r\ndrwxr-xr-x. 3 root root 63 Mar 27 2013 css\r\ndrwxr-xr-x. 2 root root 8192 Mar 27 2013 flags\r\n-rw-r--r--. 1 root root 97 Mar 27 2013 index.jsp\r\ndrwxr-xr-x. 2 root root 4096 Mar 27 2013 js\r\ndrwxr-xr-x. 2 root root 6 Jun 23 03:43 probe\r\n<\/pre>\n\u8bf4\u660e\uff1a<\/p>\n
1\uff0c\u53ef\u4ee5\u591a\u6b21\u4f7f\u7528\u2013volume-from\u53c2\u6570\u4ece\u591a\u4e2a\u5bb9\u5668\u6302\u8f7d\u591a\u4e2a\u76ee\u5f55\u3002 \u4e5f\u53ef\u4ee5\u4ece\u5176\u4ed6\u5df2\u7ecf\u6302\u8f7d\u4e86\u6570\u636e\u5377\u7684\u5bb9\u5668\u6765\u6302\u8f7d\u6570\u636e\u5377\uff08\u7c7b\u4f3c\u4f20\u9012\uff09\u3002<\/p>\n
2\uff0c\u518d\u6b21\u5f3a\u8c03\uff1a\u5982\u679c\u5220\u9664\u4e86\u6302\u8f7d\u7684\u5bb9\u5668\uff0c\u6570\u636e\u5377\u4e0d\u4f1a\u88ab\u81ea\u52a8\u5220\u9664\u3002\u5982\u679c\u8981\u5220\u9664\u5bb9\u5668\u7684\u65f6\u5019\u540c\u65f6\u5220\u9664\u6570\u636e\u5377\uff0c\u9700\u52a0\u4e0a-v\u53c2\u6570\u3002<\/p>\n
\u901a\u8fc7\u6570\u636e\u5377\u5bb9\u5668\u8fdb\u884c\u6570\u636e\u5907\u4efd\u3001\u6570\u636e\u6062\u590d\u548c\u6570\u636e\u8fc1\u79fb<\/strong><\/div>\n\u5907\u4efd<\/strong><\/span><\/div>\n\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u4e13\u95e8\u7528\u6765\u5907\u4efdprobe\u7684\u5bb9\u5668\uff1aprobebak\u8fdb\u884c\u5907\u4efd\u6570\u636e\u5377\u5bb9\u5668\u4e2d\u7684\u6570\u636e\uff0c\u547d\u4ee4\u5982\u4e0b<\/p>\n
\r\n docker run -dti --volumes-from webdata --name probebak -v \/home\/web_probebak:\/backup centos tar zcvf \/backup\/web_probe.tar.gz \/home\/web\r\n<\/pre>\n\u547d\u4ee4\u4e3a\u521b\u5efa\u4e00\u4e2a\u4e13\u7528\u5907\u4efd\u7684\u5bb9\u5668probebak\uff0c\u6302\u8f7d\u4e86\u6570\u636e\u5377\u5bb9\u5668webdata\uff0c\u540c\u65f6\u5c06\u670d\u52a1\u5668\u672c\u5730\u76ee\u5f55 \/home\/web_probebak\u6302\u8f7d\u5230\u4e86\u5907\u4efd\u5bb9\u5668\u4e0a\u7684\/backup\u76ee\u5f55\u5bb9\u5668\u542f\u52a8\u4ee5\u540e\uff0c\u4f1a\u6267\u884ctar zcvf \/backup\/web_proce.tar.gz \/home\/web\u64cd\u4f5c\uff0c\u5b8c\u6210\u670d\u52a1\u5668\u4e0a\/home\/web\u5907\u4efd\uff0c\u6253\u5305\u5230\/backup\/web_proce.tar.gz\uff0c\u4e5f\u5c31\u662f\u6253\u5305\u5230\u4e86\/home\/web_probebak\/web_probe.tar.gz \u5b9e\u73b0\u4e86\u6570\u636e\u5907\u4efd\u3002<\/p>\n
\u6062\u590d<\/strong><\/span><\/div>\n\u521b\u5efa\u4e00\u4e2a\u5bb9\u5668os999 \uff0c\u6302\u8f7d\u6709\u6570\u636e\u5377 \/testdata<\/p>\n
\r\n[root@docker5 home]# docker run -v \/testdata --name os999 centos \/bin\/bash\r\n<\/pre>\n\u518d\u5efa\u4e00\u4e2a\u5bb9\u5668\uff0c\u901a\u8fc7\u2013volumes-from os999\u6302\u8f7d\u521a\u624d\u8bbe\u7f6e\u597d\u7684\u6570\u636e\u5377\uff0c\u89e3\u538b\u6570\u636e\uff1a<\/p>\n
\r\n[root@docker5 home]# docker run --volumes-from os999 -v \/home\/web_probebak:\/backup busybox tar zxvf \/backup\/web_probe.tar.gz\r\nUsage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.\r\nhome\/web\/\r\nhome\/web\/probe.zip\r\nhome\/web\/probe\/\r\nhome\/web\/css\/\r\nhome\/web\/css\/classic\/\r\nhome\/web\/css\/classic\/datasourcetest.css\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"\u6570\u636e\u7684\u7ba1\u7406\u76ee\u524d\u63d0\u4f9b\u5982\u4e0b\u4e24\u79cd\u65b9\u5f0f\uff1a \uff081\uff09\u6570\u636e\u5377 data volumes \uff082\uff09\u6570\u636e\u5377\u5bb9\u5668 data volu […]<\/p>\n","protected":false},"author":668,"featured_media":38342,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-160850","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\/160850","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\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=160850"}],"version-history":[{"count":9,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/160850\/revisions"}],"predecessor-version":[{"id":161593,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/160850\/revisions\/161593"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/38342"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=160850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=160850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=160850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}