{"id":15901,"date":"2016-03-21T22:32:47","date_gmt":"2016-03-21T14:32:47","guid":{"rendered":"http:\/\/vmcloud.info\/?p=15901"},"modified":"2016-03-21T23:40:47","modified_gmt":"2016-03-21T15:40:47","slug":"%e3%80%90vmcloud%e4%ba%91%e5%b9%b3%e5%8f%b0%e3%80%91%e6%8b%a5%e6%8a%b1docker%ef%bc%88%e4%ba%8c%ef%bc%89%e9%85%8d%e7%bd%ae%e7%ac%ac%e4%b8%80%e4%b8%aa%e5%ae%b9%e5%99%a8","status":"publish","type":"post","link":"https:\/\/vmcloud.info\/?p=15901","title":{"rendered":"\u3010VMCloud\u4e91\u5e73\u53f0\u3011\u62e5\u62b1Docker\uff08\u4e8c\uff09\u914d\u7f6e\u7b2c\u4e00\u4e2a\u5bb9\u5668"},"content":{"rendered":"<p>\u4e0a\u4e00\u7bc7\uff0c\u6211\u4eec\u8bb2\u5230\u5982\u4f55\u53bb\u5b89\u88c5Docker\uff0c\u5728\u8fd9\u4e00\u7bc7\u4e2d\uff0c\u6211\u4eec\u5c06\u7ee7\u7eed\u6765\u8fdb\u884cDocker\u5b9e\u9a8c\uff0cDocker\u662f\u4e00\u4e2a\u53ef\u4ee5\u63d0\u4f9b\u5e94\u7528\u9694\u79bb\u73af\u5883\u7684\u5bb9\u5668\u6280\u672f\uff0c\u5e94\u7528\u7684\u4ea7\u751f\u6765\u6e90\u4e8e\u4e00\u4e2a\u4e2a\u5bb9\u5668\uff0c\u90a3\u4e48\u5bb9\u5668\u662f\u5982\u4f55\u6765\u7684\u5462\uff1f\u4eca\u5929\u5c31\u6765\u804a\u804a\u955c\u50cf\u7684\u83b7\u53d6\u4e0e\u521b\u5efa\u5bb9\u5668\u3002\u6d89\u53ca\u7684\u67b6\u6784\u5982\u4e0b\u56fe\u6240\u793a\uff1a  <\/p>\n<p><a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image002-1.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image002\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"clip_image002\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image002_thumb-1.jpg\" width=\"549\" height=\"407\"><\/a>  <\/p>\n<p>1\u3001\u4eca\u5929\u6211\u4eec\u5b9e\u9a8c\u5c06\u4f7f\u7528Wordpress\u6765\u505a\u5b9e\u9a8c\uff0c\u9996\u5148Wordpress\u5728Docker\u955c\u50cf\u5e93\u4e0a\u7684\u7f51\u5740\u662f\uff1a<a href=\"http:\/\/index.docker.io\/\">index.docker.io<\/a>\uff0c\u5f53\u7136\u4f60\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\uff08\u4e5f\u63a8\u8350\u4f7f\u7528\u547d\u4ee4\u884c\u641c\u7d22\uff09<strong>sudo docker search wordpress<\/strong>\uff1a  <\/p>\n<p><a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image004-1.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image004\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"clip_image004\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image004_thumb-1.jpg\" width=\"558\" height=\"171\"><\/a>  <\/p>\n<p>2\u3001\u63a5\u7740\u4f7f\u7528<strong>docker pull wordpress<\/strong>\u8fdb\u884c\u5b89\u88c5\uff08\u8fd9\u91cc\u7684\u955c\u50cf\u540d\u9700\u8981\u586b\u5b8c\u6574\u540d\u79f0\uff09\uff1a  <\/p>\n<p><a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image006-1.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image006\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"clip_image006\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image006_thumb-1.jpg\" width=\"557\" height=\"42\"><\/a>  <\/p>\n<p>3\u3001\u8fd9\u6837\uff0c\u4f60\u5c31\u62e5\u6709\u4e86\u7b2c\u4e00\u4e2a\u5bb9\u5668\uff0c\u8fd9\u4e2a\u5bb9\u5668\u7684\u7c7b\u578b\u662fWordpress\uff0c\u7136\u800c\u5e76\u4e0d\u80fd\u9a6c\u4e0a\u4f7f\u7528\uff0c\u56e0\u4e3aWordpress\u9700\u8981\u7ed3\u5408Mysql\u6765\u7528\uff0c\u6240\u4ee5\u4f60\u8fd8\u9700\u8981\u4e0b\u8f7dMysql\u5bb9\u5668\u6765\u505a\u7ed3\u5408\uff1a  <\/p>\n<p><strong>docker search mysql<\/strong>  <\/p>\n<p><strong>docker pull mysql <\/strong> <\/p>\n<p><a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image008-1.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image008\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"clip_image008\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image008_thumb-1.jpg\" width=\"557\" height=\"204\"><\/a><strong><\/strong>  <\/p>\n<p>4\u3001Docker\u5bb9\u5668\u7684\u6982\u5ff5\u6709\u70b9\u50cf\u6c99\u76d2\uff0c\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38duang\u7684\u6982\u5ff5\uff0c\u53ef\u4ee5\u5229\u7528\u955c\u50cf\u751f\u6210\u5bb9\u5668\uff0c\u6bcf\u4e2a\u5bb9\u5668\u76f8\u5f53\u4e8e\u4e00\u4e2a\u72ec\u7acb\u7684\u73af\u5883\uff0c\u6bd4\u5982\u6211\u4eec\u8981\u642d\u5efaWordpress\uff0c\u6211\u4eec\u9700\u8981\u5148\u542f\u52a8\u4e00\u4e2aMysql\u7684\u5bb9\u5668mysql_root_password\u662f\u8bbe\u7f6edb\u5bc6\u7801\uff08\u7531\u4e8e\u535a\u4e3b\u7684\u865a\u62df\u673a\u7ed9\u7684RAM\u592a\u5c0f\uff0c\u7528\u539f\u751f\u7684last\u7248\u672c\u7684Mysql\u4f1a\u63d0\u793aRAM\u4e0d\u8db3\u5bfc\u81f4Mysql\u6570\u636e\u5e93\u65e0\u6cd5\u6b63\u5e38\u8fd0\u884c\uff0c\u6545\u8fd9\u91cc\u91cd\u65b0pull\u4e86\u4e00\u4e2amysql 5.7\uff09\uff1a  <\/p>\n<p><strong>docker run &#8211;name wordpressdb -e MYSQL_ROOT_PASSWORD=xxxx -d mysql5.7<\/strong>  <\/p>\n<p><a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image010-1.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image010\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"clip_image010\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image010_thumb-1.jpg\" width=\"557\" height=\"72\"><\/a>  <\/p>\n<p>5\u3001\u5bb9\u5668\u5728Linux\u4e0a\u5448\u73b0\u4e3a\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4efb\u4f55\u7684\u8fd0\u884c\u90fd\u5728\u8fd9\u4e2a\u8fdb\u7a0b\u4e2d\u6267\u884c\uff0c\u5982\u679c\u5b58\u5728\u591a\u4e2a\u5bb9\u5668\uff0c\u5b83\u4eec\u4e4b\u95f4\u4e5f\u662f\u9694\u79bb\u7684\uff0c\u6545\u5b89\u5168\u6027\u975e\u5e38\u9ad8\uff0c\u6211\u4eec\u53ef\u4ee5\u7528<strong>docker ps<\/strong>\u67e5\u770b\u4e0b\u521a\u521a\u521b\u5efa\u7684db\u662f\u5426\u6b63\u5e38\uff1a  <\/p>\n<p><a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image012-1.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image012\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"clip_image012\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image012_thumb-1.jpg\" width=\"558\" height=\"43\"><\/a>  <\/p>\n<p>6\u3001\u63a5\u7740\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528Wordpress\u7ed3\u5408Mysql\u4e86\u6765\u642d\u5efa\u7b2c\u4e00\u4e2a\u5bb9\u5668\uff0c\u7531\u4e8eWordpress\u9700\u8981php\u73af\u5883\uff0c\u6211\u4eec\u8fd0\u884c<strong>docker run &#8211;name wordpress php:5.6-apache<\/strong><strong> <\/strong><strong>\u6765\u5b89\u88c5<\/strong><strong>php<\/strong><strong>\u4f9d\u8d56\u6761\u4ef6\uff0c\u7136\u540e\u518d\u4f7f\u7528<\/strong><strong> docker run &#8211;name vmcloud_wordpress &#8211;link wordpressdb:mysql -p 3306:80 -d wordpress<\/strong><strong>\u6765\u8fd0\u884c\u4e00\u4e2a<\/strong><strong>WordPress<\/strong><strong>\u5bb9\u5668\uff08\u8bf7\u6ce8\u610f\u4e00\u5b9a\u8981\u6307\u5b9a\u597d\u7aef\u53e3<\/strong><strong> \u2013p<\/strong><strong>\uff0c\u8fd9\u91cc\u662f\u5c06\u5bb9\u5668\u5185\u7684<\/strong><strong>80<\/strong><strong>\u7aef\u53e3\u6620\u5c04\u4e3a<\/strong><strong>3306,<\/strong><strong>\uff09\uff0c\u7136\u540e\u6211\u4eec\u518d\u6765<\/strong><strong>docker ps<\/strong><strong>\u770b\u4e0b\u8fdb\u7a0b<\/strong>\uff1a  <\/p>\n<p><a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image014-1.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image014\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"clip_image014\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image014_thumb-1.jpg\" width=\"558\" height=\"58\"><\/a>  <\/p>\n<p>7\u3001\u7136\u540e\u505a\u4e2aportmap\uff0c\u8f93\u5165\u5bf9\u5e94\u7684URL\uff1a3306\uff0c\u4f60\u5c31\u4f1a\u53d1\u73b0\u60ca\u559c\uff1a  <\/p>\n<p><a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image016.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image016\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"clip_image016\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image016_thumb.jpg\" width=\"557\" height=\"424\"><\/a>  <\/p>\n<p>8\u3001\u6211\u4eec\u518d\u6765\u770b\u770b\u8fd0\u884c\u4e86\u4e00\u4e2aMysql+Wordpress\u7684\u5bb9\u5668\u5360\u7528\u4e3b\u673a\u5927\u6982\u591a\u5c11\u8d44\u6e90\uff1a  <\/p>\n<p><a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image018.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image018\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"clip_image018\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/clip_image018_thumb.jpg\" width=\"558\" height=\"344\"><\/a>  <\/p>\n<hr>\n<p> <a href=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/logo.png\"><img loading=\"lazy\" decoding=\"async\" title=\"logo\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto\" border=\"0\" alt=\"logo\" src=\"https:\/\/vmcloud.info\/wp-content\/uploads\/2016\/03\/logo_thumb.png\" width=\"533\" height=\"347\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u4e00\u7bc7\uff0c\u6211\u4eec\u8bb2\u5230\u5982\u4f55\u53bb\u5b89\u88c5Docker\uff0c\u5728\u8fd9\u4e00\u7bc7\u4e2d\uff0c\u6211\u4eec\u5c06\u7ee7\u7eed\u6765\u8fdb\u884cDocker\u5b9e\u9a8c\uff0cDocker\u662f\u4e00\u4e2a\u53ef\u4ee5\u63d0\u4f9b\u5e94\u7528\u9694\u79bb\u73af\u5883\u7684\u5bb9\u5668\u6280\u672f\uff0c\u5e94\u7528\u7684\u4ea7\u751f\u6765\u6e90\u4e8e\u4e00\u4e2a\u4e2a\u5bb9\u5668\uff0c\u90a3\u4e48\u5bb9\u5668\u662f\u5982\u4f55\u6765\u7684\u5462\uff1f\u4eca\u5929\u5c31\u6765\u804a\u804a\u955c\u50cf\u7684\u83b7\u53d6\u4e0e\u521b\u5efa\u5bb9\u5668\u3002\u6d89\u53ca\u7684\u67b6\u6784\u5982\u4e0b\u56fe\u6240\u793a\uff1a 1\u3001\u4eca\u5929\u6211\u4eec\u5b9e\u9a8c\u5c06\u4f7f\u7528Wordpress\u6765\u505a\u5b9e\u9a8c\uff0c\u9996\u5148Wordpress\u5728Docker\u955c\u50cf\u5e93\u4e0a\u7684\u2026\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[231],"tags":[],"class_list":["post-15901","post","type-post","status-publish","format-standard","hentry","category-231"],"_links":{"self":[{"href":"https:\/\/vmcloud.info\/index.php?rest_route=\/wp\/v2\/posts\/15901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vmcloud.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmcloud.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmcloud.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vmcloud.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15901"}],"version-history":[{"count":1,"href":"https:\/\/vmcloud.info\/index.php?rest_route=\/wp\/v2\/posts\/15901\/revisions"}],"predecessor-version":[{"id":15911,"href":"https:\/\/vmcloud.info\/index.php?rest_route=\/wp\/v2\/posts\/15901\/revisions\/15911"}],"wp:attachment":[{"href":"https:\/\/vmcloud.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmcloud.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmcloud.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}