{"id":2750,"date":"2019-01-23T01:49:04","date_gmt":"2019-01-22T17:49:04","guid":{"rendered":"https:\/\/damogame.cn:15443\/wordpress\/?p=2750"},"modified":"2019-01-24T19:40:03","modified_gmt":"2019-01-24T11:40:03","slug":"docker%e5%9b%be%e5%bd%a2%e9%a1%b5%e9%9d%a2%e7%ae%a1%e7%90%86%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/2750","title":{"rendered":"DOCKER\u56fe\u5f62\u9875\u9762\u7ba1\u7406\u5de5\u5177"},"content":{"rendered":"<div class=\"article-header-box\">\n<div class=\"article-header\">\n<div class=\"article-title-box\"><\/div>\n<div class=\"article-info-box\">\n<div class=\"operating\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<article class=\"baidu_pl\">\n<div id=\"article_content\" class=\"article_content clearfix csdn-tracking-statistics\" data-pid=\"blog\" data-mod=\"popu_307\" data-dsm=\"post\">\n<div id=\"content_views\" class=\"htmledit_views\">\n<h1>DOCKER\u56fe\u5f62\u9875\u9762\u7ba1\u7406\u5de5\u5177&#8211;3\u79cd\u3002<\/h1>\n<h1><a name=\"t1\"><\/a>\u57fa\u672c\u4e0a\u662f3\u4e2a\u5de5\u5177\uff0cDOCKER UI\uff0cshipyard,portainer\u3002\u5bf9\u6bd4\u540e\uff0cshipyard\u6700\u5f3a\u5927\uff0c\u5176\u6b21\u662fportainer,\u6700\u540e\u662fdocker ui\u3002<\/h1>\n<h1><\/h1>\n<h1><\/h1>\n<p>docker\u9488\u5bf9\u4e8e\u7cfb\u7edf\u5de5\u7a0b\u5e08\u6216\u8005\u5f00\u53d1\u4eba\u5458\u6765\u8bf4\u64cd\u4f5c\u6bd4\u8f83\u7b80\u5355\u3002\u4e00\u822c\u6211\u4eec\u4e60\u60ef\u4e86\u5bf9\u7740\u9ed1\u9ed1\u7684\u5c4f\u5e55\u6572\u547d\u4ee4\uff0cdocker pull\uff0cdocker push\uff0cdocker run\uff0cdocker logs\uff0cdocker ps\u7b49\u7b49\u3002\u6216\u8005\u6211\u4eec\u5c06\u5e38\u7528\u7684docker\u539f\u751fapi\u5c01\u88c5\u5230\u6211\u4eec\u7684shell\u811a\u672c\u5de5\u5177\u6216\u8005python\u811a\u672c\u5de5\u5177\u4e2d\u53bb\u4f7f\u7528\u7ba1\u7406docker\u3002\u7136\u800c\u5bf9\u4e8e\u90e8\u5206\u7528\u6237\uff0c\u6216\u8005\u8bf4\u975e\u6280\u672f\u7528\u6237\u53bb\u4f7f\u7528docker\u96be\u5ea6\u5176\u5b9e\u4e0d\u5c0f\u3002\u56e0\u6b64\u4e00\u4e2a\u660e\u4e86\u7684\u53ef\u89c6\u5316\u7ba1\u7406\u754c\u9762\u663e\u5f97\u975e\u5e38\u91cd\u8981\u4e86\u3002\u4e07\u7269\u8bde\u751f\u603b\u6709\u5176\u8bde\u751f\u7684\u7406\u7531\u3002\u53ef\u80fd\u53ea\u662f\u4e3a\u4e86\u670d\u52a1\u67d0\u90e8\u5206\u4eba\u3002\u4e0b\u9762\u8bf4\u4e00\u4e0b\u4e24\u4e2a\u6bd4\u8f83\u5e38\u7528\u7684docker\u7ba1\u7406\u5e73\u53f0\uff08dockerui\u548cshiyard\uff09\uff0c\u4ee5\u4e0b\u90fd\u662f\u7ecf\u8fc7\u672c\u4eba\u4eb2\u6d4b\u7684\uff0c\u8ba9\u6211\u8bf4\u8bf4\u6211\u7684\u4f7f\u7528\u611f\u53d7\u3002<\/p>\n<p>dockerui<\/p>\n<p>\u90e8\u7f72\u65b9\u9762\uff1a<\/p>\n<p>\u76f4\u63a5\u6267\u884c\u547d\u4ee4\uff0c\u5c06dockerui\u5bb9\u5668<a href=\"https:\/\/www.baidu.com\/s?wd=%E9%95%9C%E5%83%8F&amp;tn=24004469_oem_dg&amp;rsv_dl=gh_pl_sl_csd\" target=\"_blank\" rel=\"noopener\">\u955c\u50cf<\/a>\u4e0b\u8f7d\u5230\u672c\u5730\u6620\u5c04\u52309000\u7aef\u53e3\uff0c\u4ee5\u5bb9\u5668\u7684\u65b9\u5f0f\u542f\u52a8\u5373\u53ef\u3002<\/p>\n<p>docker run -d -p 9000:9000 -v \/var\/run\/docker.sock:\/var\/run\/docker.sock dockerui\/dockerui<\/p>\n<p>\u90e8\u7f72\u6210\u529f\u540e\uff0c\u5728<a href=\"https:\/\/www.baidu.com\/s?wd=%E6%9C%8D%E5%8A%A1%E5%99%A8&amp;tn=24004469_oem_dg&amp;rsv_dl=gh_pl_sl_csd\" target=\"_blank\" rel=\"noopener\">\u670d\u52a1\u5668<\/a>\u4e2d\u6267\u884cdocker ps \u786e\u5b9a\u5bb9\u5668\u662f\u5426\u8d77\u6765\u4e86\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/11.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/11.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u5982\u4e0a\u56fe\u6240\u793a\uff0c\u5373\u53ef\u5224\u5b9a\u5bb9\u5668\u5df2\u7ecf\u8d77\u6765\u4e86\u3002<\/p>\n<p>\u5728\u6d4f\u89c8\u5668\u8f93\u5165ip:9000\u5373\u53ef\u8bbf\u95ee\u4e86\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/112.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/112.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u754c\u9762\u5982\u4e0a\uff0c\u754c\u9762\u6bd4\u8f83\u6574\u6d01\u3002<a href=\"https:\/\/www.baidu.com\/s?wd=%E9%A6%96%E9%A1%B5&amp;tn=24004469_oem_dg&amp;rsv_dl=gh_pl_sl_csd\" target=\"_blank\" rel=\"noopener\">\u9996\u9875<\/a>\u7684\u4fe1\u606f\u5206\u522b\u662f\u8fd0\u884c\u4e2d\u7684\u5bb9\u5668\uff08\u9644\u5e26\u8fd0\u884c\u4e86\u7684\u65f6\u95f4\uff09\uff0c\u5bb9\u5668\u521b\u5efa\u8bb0\u5f55\u66f2\u7ebf\uff0c\u548c\u955c\u50cf\u521b\u5efa\u8bb0\u5f55\u66f2\u7ebf\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/113.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/113.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u4e0a\u56fe\u4e3a\u5bb9\u5668\u7ba1\u7406\u7684\u754c\u9762\uff0c\u4e0a\u9762\u5217\u51fa\u4e86\u6b63\u5728\u8dd1\u7684\u5bb9\u5668\u60c5\u51b5\uff0c\u5305\u62ec\u5bb9\u5668\u540d\uff0c\u955c\u50cf\uff0c\u547d\u4ee4\uff0c\u4ee5\u53ca\u521b\u5efa\u65f6\u95f4\u3002\u9488\u5bf9\u4e8e\u5177\u4f53\u7684\u5bb9\u5668\u53ef\u4ee5\u70b9\u51fb\u8fdb\u53bb\u7ba1\u7406\uff0c\u4e0b\u56fe\u6211\u4ee5\u540d\u4e3alamp\u7684\u5bb9\u5668\u4e3a\u4f8b\u8bf4\u660e\uff1a<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/114.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/114.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u5bb9\u5668\u7ba1\u7406\u57fa\u672c\u5982\u4e0a\u56fe\uff0c\u5c55\u793a\u7684\u4fe1\u606f\u6bd4\u8f83\u9f50\u5168\uff0c\u4f46\u662f\u5ffd\u7565\u4e86\u6211\u4eec\u6bd4\u8f83\u5e38\u7528\u7ba1\u7406\u5bb9\u5668\u7684\u65b9\u5f0f\u4e4b\u4e00\uff0c\u5c31\u662f\u67e5\u770b\u65e5\u5fd7\u529f\u80fd\u4e5f\u5c31\u662fcmd docker logs\u7684\u5c55\u793a\uff0c\u4e5f\u5c11\u4e86\u8fde\u63a5\u5230\u5bb9\u5668\u5185\u90e8\u6267\u884c\u547d\u4ee4\u7684\u53ef\u89c6\u5316\u64cd\u4f5c\uff0c\u4e5f\u5c31\u662fcmd docker exec \u3002\u5f53\u7136\u5728\u8fd9\u4e2a\u5bb9\u5668\u7ba1\u7406\u754c\u9762\u6211\u6ca1\u6709\u53d1\u73b0\u4efb\u4f55\u548c\u5bb9\u5668\u96c6\u7fa4\u6709\u5173\u7684\u4fe1\u606f\uff0c\u4e5f\u5c31\u662f\u8bf4dockerui\u4e0d\u80fd\u7ba1\u7406docker\u96c6\u7fa4\uff0c\u53ea\u80fd\u7ba1\u7406\u5355\u673a\u7684\u5bb9\u5668\uff0c\u8fd9\u4e2a\u75db\u70b9\u76f8\u5f53\u5927\u3002<\/p>\n<p>\u7ee7\u7eed\u5bb9\u5668\u7f51\u7edc\u7ba1\u7406\u754c\u9762<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/116.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/116.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u8fd9\u4e2a\u5c55\u793a\u4e0d\u9519\uff0c\u53ef\u4ee5\u770b\u5230\u4e92\u76f8\u4e4b\u95f4\u5b58\u5728\u901a\u8baf\u5173\u7cfb\u7684\u5bb9\u5668\u3002\u663e\u793a\u4e5f\u7b97\u6bd4\u8f83\u76f4\u89c2\uff0c\u597d\u770b\u3002<\/p>\n<p>\u518d\u770b\u770bimages\u7ba1\u7406\u754c\u9762\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/117.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/117.jpg\" alt=\"11\" \/><\/a>\u754c\u9762\u597d\u770b\uff0c\u663e\u793a\u4e0d\u9519\uff0c\u5e26\u4e86pull\u7684\u529f\u80fd\u548c\u641c\u7d22\u529f\u80fd\u3002\u5927\u5c0f\uff0c\u521b\u5efa\u65f6\u95f4\uff0c\u955c\u50cfID\u8fd9\u4e9b\u4e00\u4e2a\u90fd\u4e0d\u5c11\u3002<\/p>\n<p>\u6700\u540e\u8fd8\u6709\u4e00\u4e2ainfo\u7684\u9009\u9879\uff0c\u8fd9\u4e2a\u6211\u5c31\u4e0d\u4ecb\u7ecd\u4e86\uff0c\u5b83\u5c31\u662f\u663e\u793a\u4e86\u6574\u53f0\u670d\u52a1\u5668\u7684\u5bb9\u5668\u955c\u50cf\u7684\u7edf\u8ba1\uff0c\u670d\u52a1\u5668\u914d\u7f6e\u4ee5\u53cadockerui\u7684\u76f8\u5173\u7248\u672c\u4fe1\u606f\u800c\u5df2\uff0c\u53ef\u4ee5\u7406\u89e3\u6210\u7136\u5e76\u5375\u7684\u90e8\u5206\u3002<\/p>\n<p>\u603b\u7ed3\u4e00\u4e0bdockerui\u4f7f\u7528\u611f\u53d7\u3002<\/p>\n<p>1.\u603b\u4f53\u6765\u8bf4\u754c\u9762\u6bd4\u8f83\u597d\u770b\uff0c\u5e72\u51c0\u7b80\u6d01\u3002<\/p>\n<p>2.\u7cfb\u7edf\u6ca1\u6709\u767b\u5f55\u9a8c\u8bc1\u529f\u80fd\uff0c\u5176\u5b9e\u4e5f\u6ca1\u5fc5\u8981\u6dfb\u52a0\uff0c\u56e0\u4e3a\u5b83\u53ea\u80fd\u7ba1\u7406\u672c\u5730\u5355\u673a\u7684docker\u5bb9\u5668\u3002\u6ca1\u6709\u6279\u91cf\u7ba1\u7406\u529f\u80fd\u3002\uff08\u8fd9\u4e2a\u5f88\u81f4\u547d\uff09<\/p>\n<p>3.\u6211\u4eec\u7ecf\u5e38\u5bf9\u5bb9\u5668\u7684\u64cd\u4f5c\u65e0\u975e\u521b\u5efa\uff0c\u4ea4\u4e92\u6267\u884c\u547d\u4ee4\uff0c\u67e5\u770b\u65e5\u5fd7\u548c\u67e5\u770b\u5065\u5eb7\u72b6\u6001\u3002dockerui\u8fd9\u65b9\u9762\u529f\u80fd\u4e0d\u591f\u5168\u9762\uff0c\u7f3a\u5c11\u4e86\u521b\u5efa\uff0c\u4ea4\u4e92\u6267\u884c\u547d\u4ee4\u4ee5\u53ca\u67e5\u770b\u65e5\u5fd7\u7684\u529f\u80fd\u3002\uff08\u8fd9\u4e2a\u76f8\u5f53\u81f4\u547d\uff09<\/p>\n<p>4.\u8fd9\u4e2a\u5e73\u53f0\u7136\u5e76\u5375\uff0c\u4f60\u8981\u7ba1\u7406\u5bb9\u5668\u8fd8\u5f97\u9700\u8981\u4ece\u670d\u52a1\u5668\u91cc\u9762\u64cd\u4f5c\u3002\u8fd9\u4e2a\u5e73\u53f0\u53ea\u80fd\u7b97\u662f\u4e00\u4e2a\u6446\u8bbe\u7684\u82b1\u74f6\uff0c\u770b\u770b\u800c\u5df2\u3002<\/p>\n<p>===========\u4e0d\u662f\u5f88\u534e\u4e3d\u7684\u5206\u5272\u7ebf====================<\/p>\n<p>shipyard \u00a0\u5b98\u7f51\u5730\u5740\uff1ahttp:\/\/www.shipyard-project.com<\/p>\n<p>\u90e8\u7f72\u65b9\u6cd5\uff0c\u4e00\u6837\u7b80\u5355\uff1a<\/p>\n<p>curl\u00a0-sSL https:\/\/shipyard-project.com\/deploy | bash\u00a0-s \u00a0\u5373\u53ef\uff0c\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u9010\u4e2a\u7ec4\u4ef6\u542f\u52a8\uff0c\u4e0d\u8fc7\u8981\u6ce8\u610f\u5148\u540e\u548clink\u3002\u4e0b\u9762\u6709\u542f\u52a8\u8bf4\u660e\u3002<\/p>\n<p>\u90e8\u7f72\u5b8c\u6210\u540e\u67e5\u770b\u4e00\u4e0b\u5230\u65f6\u8dd1\u4e86\u4ec0\u4e48\u5bb9\u5668\uff0c\u5982\u4e0b\u56fe<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/118.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/118.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u89e3\u91ca\u4e00\u4e0b\uff1adocker ps\u770b\u5230\u4e86\u4e00\u5927\u5806\uff0c\u633a\u5413\u4eba\u7684\u3002\u73b0\u5728\u8bf4\u660e\u4e00\u4e0b\uff0c\u6700\u65b0\u7684shipyard\u96c6\u6210\u4e86swarm\u7ba1\u7406\uff0c\u81f3\u4e8e\u4ec0\u4e48\u662fswarm\uff0c\u8fd9\u91cc\u5c31\u4e0d\u591a\u8bf4\u4e86\uff0c\u53ef\u4ee5\u53bb\u5b98\u7f51\u770b\u4e0b\uff1ahttps:\/\/docs.docker.com\/swarm\/ \u00a0\u6211\u4eec\u53ea\u9700\u8981\u77e5\u9053swarm\u662f\u4e00\u4e2a\u7ba1\u7406docker\u96c6\u7fa4\u7684\u5de5\u5177\u5c31\u884c\uff0c\u5b83\u5206\u4e3aswarm-manager\u548cswarm-agent\uff0c\u53ef\u4ee5\u7406\u89e3\u6210\u4e3a\u4e3b\u548c\u4ec6\u7684\u5173\u7cfb\u3002<\/p>\n<p>shipyard-swarm-agent \u00a0 swarm agent \u63d2\u4ef6\uff0c\u5141\u8bb8\u8282\u70b9\u53bb\u8c03\u5ea6\u5bb9\u5668\u3002\uff08\u8fd9\u4e2a\u662fshipyard\u6279\u91cf\u7ba1\u7406\u8282\u70b9\u5bb9\u5668\u7684\u5173\u952e\u70b9\uff09<\/p>\n<p>\u542f\u52a8\u547d\u4ee4\uff1adocker run \u00a0-ti\u00a0-d\u00a0\u2013restart=always \u00a0\u2013name shipyard-swarm-agent \u00a0swarm:latest \u00a0join \u2013addr &lt;ip-of-host&gt;:2375\u00a0etcd:\/\/&lt;ip-of-host&gt;:4001<\/p>\n<p>shipyard-swarm-manager \u00a0 swarm manager \u7ba1\u7406<\/p>\n<p>\u542f\u52a8\u547d\u4ee4\u662f\uff1adocker run \u00a0-ti \u00a0-d\u00a0 \u2013restart=always \u00a0\u2013name shipyard-swarm-manager \u00a0swarm:latest \\manage \u2013host tcp:\/\/0.0.0.0:3375\u00a0etcd:\/\/&lt;IP-OF-HOST&gt;:4001<\/p>\n<p>shipyard-proxy \u00a0\u9ed8\u8ba4\u60c5\u51b5\u4e0bdocker\u670d\u52a1\u53ea\u76d1\u542c\u4e00\u4e2a\u7aef\u53e3\uff0c\u6211\u4eec\u91cd\u65b0\u914d\u7f6edocker\u53ef\u4ee5\u4f7f\u7528TLS\u5c31\u5fc5\u987b\u8981\u542f\u52a8\u591a\u4e00\u4e2aproxy\u7528\u4e8e\u62a5\u6587\u8f6c\u53d1\u3002TLS\u662f\u4ec0\u4e48\uff1fTLS\u662f\u5b89\u5168\u5c42\u4f20\u8f93\u534f\u8bae\uff0c\u7528\u4e8e\u5728\u4e24\u4e2a\u901a\u4fe1\u5e94\u7528\u7a0b\u5e8f\u4e4b\u95f4\u63d0\u4f9b\u4fdd\u5bc6\u6027\u548c\u6570\u636e\u5b8c\u6574\u6027\u7684\u3002<\/p>\n<p>\u542f\u52a8\u547d\u4ee4\u662f\uff1adocker run \u00a0-ti \u00a0-d\u00a0 -p\u00a02375:2375\u00a0 \u2013hostname=$HOSTNAME\u00a0\u2013restart=always \u2013name shipyard-proxy -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \u00a0-e\u00a0PORT=2375\u00a0ehazlett\/docker-proxy:latest<\/p>\n<p>shipyard-certs \u00a0\u8fd9\u4e2a\u4e1c\u4e1c\u662f\u6574\u4e2ashipyard\u7cfb\u7edf\u4e2d\u5141\u8bb8\u652f\u6301TLS\u7684\u7ec4\u4ef6\uff0c\u6211\u662f\u8fd9\u6837\u7406\u89e3\u7684\u3002<\/p>\n<p>\u542f\u52a8\u547d\u4ee4\uff1adocker run -ti -d \u2013name shipyard-certs\u00a0alpine:latest<\/p>\n<p>shipyard-controller \u00a0 \u53ef\u4ee5\u7406\u89e3\u6210shipyard\u7684\u63a7\u5236\u7a0b\u5e8f\u5427\uff0c\u542f\u52a8\u505c\u6b62shipyard\u3002<\/p>\n<p>\u542f\u52a8\u547d\u4ee4\u662f\uff1adocker run \u00a0-ti \u00a0-d\u00a0 \u2013restart=always \u00a0\u2013name shipyard-controller \u00a0\u2013link shipyard-rethinkdb:rethinkdb \u2013link shipyard-swarm-manager:swarm \u00a0-p\u00a08080:8080\u00a0 shipyard\/shipyard:latest \u00a0server \u00a0-d\u00a0tcp:\/\/swarm:3375<\/p>\n<p>shipyard-discovery \u00a0 \u00a0\u7528\u4e8e\u6388\u6743swarm manage\u9009\u4e3e\uff0c\u7528etcd\u5b58\u50a8swarm\u5bb9\u5668\u5bf9\u7528\u7684key\u548cvalues\u3002etcd\u662f\u4ec0\u4e48\u8fd9\u91cc\u4e5f\u4e0d\u591a\u4ecb\u7ecd\u4e86\uff0c\u611f\u5174\u8da3\u53ef\u4ee5\u79c1\u4e0b\u770b\u3002etcd\u662f\u4e00\u4e2a\u9ad8\u53ef\u7528\u7684key-values\u5b58\u50a8\u7cfb\u7edf\u3002<\/p>\n<p>\u542f\u52a8\u547d\u4ee4\u662f\uff1adocker run -ti\u00a0-d\u00a0 -p\u00a04001:4001\u00a0 -p\u00a07001:7001\u00a0 \u2013restart=always \u00a0\u2013name shipyard-discovery \u00a0microbox\/etcd -name discovery<\/p>\n<p>shipyard-rethinkdb \u00a0 \u00a0shipyard\u6570\u636e\u5b58\u50a8<\/p>\n<p>\u542f\u52a8\u547d\u4ee4\u662f\uff1adocker run \u00a0-ti\u00a0-d\u00a0 \u2013restart=always \u00a0\u2013name shipyard-rethinkdb \u00a0rethinkdb<\/p>\n<p>\u4e0a\u9762\u628ashipyard\u76f8\u5173\u7684\u7ec4\u4ef6\u90fd\u6e05\u695a\u7684\u8bf4\u660e\u4e86\u4e00\u8f6e\uff0c\u73b0\u5728\u5f00\u59cb\u4ecb\u7ecd\u7ba1\u7406\u754c\u9762\uff0c\u4ecedocker ps\u770b\u51fashipyard\u6620\u5c04\u51fa\u6765\u7684\u7aef\u53e3\u662f8080\uff0c\u56e0\u6b64\u8bbf\u95ee\u5b83\u7684\u754c\u9762\u662fhttp:\/\/ip\uff1a8080 \u5b89\u88c5\u5b8c\u6bd5\u540e\u6709\u7528\u6237\u540d\u548c\u5bc6\u7801\u63d0\u793a\u7684\uff0c\u7528\u6237\u540d\u662fadmin\u5bc6\u7801\u662fshipyard\uff08\u5f53\u7136\u8fd9\u4e2a\u662f\u53ef\u4ee5\u5728\u8fdb\u5165\u7ba1\u7406\u5e73\u53f0\u540e\u4fee\u6539\u7684\uff09\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/119.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/119.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u767b\u5f55\u8fdb\u53bb\u754c\u9762\u5982\u4e0a\uff0c\u754c\u9762\u4e5f\u662f\u5341\u5206\u597d\u770b\u7684\uff0c\u5bfc\u822a\u680f\u5206\u522b\u662f\u5bb9\u5668\uff08\u9ed8\u8ba4\u9996\u9875\uff09\uff0c\u955c\u50cf\uff0c\u8282\u70b9\uff0c\u4ed3\u5e93\uff0c\u4ee5\u53ca\u7528\u6237\u7ba1\u7406\u548c\u64cd\u4f5c\u65e5\u5fd7\u3002<\/p>\n<p>\u5bb9\u5668\u7ba1\u7406\u754c\u9762<a href=\"https:\/\/www.baidu.com\/s?wd=%E4%B8%80%E7%9B%AE%E4%BA%86%E7%84%B6&amp;tn=24004469_oem_dg&amp;rsv_dl=gh_pl_sl_csd\" target=\"_blank\" rel=\"noopener\">\u4e00\u76ee\u4e86\u7136<\/a>\uff0c\u5bb9\u5668\u5065\u5eb7\u60c5\u51b5\uff0c\u5bb9\u5668ID\uff0c\u5bb9\u5668\u5728\u54ea\u4e2a\u8282\u70b9\u542f\u52a8\uff0c\u5bb9\u5668\u540d\u79f0\uff0c\u542f\u52a8\u7684\u955c\u50cf\uff0c\u8fd0\u884c\u65f6\u957f\uff0c\u521b\u5efa\u65f6\u95f4\u90fd\u5341\u5206\u660e\u4e86\u3002\u7559\u610f\u4e00\u4e0b\u5de6\u4e0a\u89d2\u7684\u5237\u65b0\u6309\u94ae\uff0c\u53f3\u8fb9\u591a\u4e86\u4e00\u4e2a\u521b\u5efa\u6309\u94ae\uff0c\u8bf4\u660e\u4e86shipyard\u652f\u6301\u521b\u5efa\u5bb9\u5668\uff0c\u4ee5\u4e0b\u662f\u521b\u5efa\u7684\u754c\u9762\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1110.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1110.jpg\" alt=\"11\" \/><\/a>\u521b\u5efa\u5bb9\u5668\u7684\u754c\u9762\u529f\u80fd\u9009\u62e9\u975e\u5e38\u591a\uff0c\u53ef\u4ee5\u5728\u8fd9\u91cc\u5b9a\u4e49\u5bb9\u5668\u7684\u4e3b\u673a\u540d\uff0c\u5bb9\u5668\u9700\u8981\u6302\u8f7d\u672c\u5730\u7684\u76ee\u5f55\u60c5\u51b5\uff0c\u7aef\u53e3\u6620\u5c04\uff0ccpu\u548c\u5185\u5b58\u9650\u5236\u7b49\u7b49\uff0c\u8fd9\u91cc\u90fd\u53ef\u4ee5\u9009\u62e9\u3002\u53ef\u89c1shipyard\u5c06docker run\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u5e26\u7684\u53c2\u6570\u57fa\u672c\u90fd\u5c01\u88c5\u5230\u4e86web\u4e0a\uff0c\u8fd9\u70b9\u975e\u5e38\u597d\u3002<\/p>\n<p>\u4e0b\u9762\u7ee7\u7eed\u770b\u4e0b\u5bb9\u5668\u754c\u9762\u53f3\u8fb9action\u7684\u4e24\u4e2a\u9009\u9879\uff0c\u5206\u522b\u662f\u4e00\u4e2a\u653e\u5927\u955c\u5f62\u72b6\u7684\u548c<a href=\"https:\/\/www.baidu.com\/s?wd=%E6%89%B3%E6%89%8B&amp;tn=24004469_oem_dg&amp;rsv_dl=gh_pl_sl_csd\" target=\"_blank\" rel=\"noopener\">\u6273\u624b<\/a>\u5f62\u72b6\u7684\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1111.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1111.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u6273\u624b\u5f62\u72b6\u7684\u529f\u80fd\u662f\u5bf9\u5bb9\u5668\u7684\u5177\u4f53\u64cd\u4f5c\uff0c\u542f\u52a8\uff0c\u505c\u6b62\uff0c\u5220\u9664\uff0c\u800c\u4e14\u8fd9\u91cc\u4e5f\u5305\u62ec\u4e86\u6211\u4eec\u6bd4\u8f83\u5e38\u7528\u7684\u5065\u5eb7\u76d1\u63a7\uff08CPU\uff0c\u5185\u5b58\uff0c\u53ef\u4ee5\u67e5\u770b5\u79d210\u79d230\u79d21\u5206\u949f\u7684\u56fe\u8868\uff09\uff0c\u547d\u4ee4\u884cconsole\u64cd\u4f5c\u548c\u67e5\u770b\u65e5\u5fd7\u7684logs\u64cd\u4f5c\u3002\u8fd9\u4e2a\u5341\u5206\u4eba\u6027\u5316\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1113.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1113.jpg\" alt=\"111\" \/><\/a><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/11111.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/11111.jpg\" alt=\"1111\" \/><\/a><\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1112.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1112.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u53e6\u5916\u4e00\u4e2a\u653e\u5927\u955c\u7684\u9009\u9879\u662f\u9488\u5bf9\u5bb9\u5668\u7684\u5177\u4f53\u4fe1\u606f\u9875\u9762\u5982\u4e0b\uff1a\u4fe1\u606f\u5341\u5206\u8be6\u7ec6\uff0c\u5305\u62ec\u6302\u8f7d\uff0c\u7aef\u53e3\u6620\u5c04\uff0c\u6267\u884c\u547d\u4ee4\u548c\u5bb9\u5668\u91cc\u542f\u52a8\u7684\u8fdb\u7a0b\u4fe1\u606f\u4e00\u4e2a\u4e0d\u5c11\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1114.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1114.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u4e0b\u9762\u770b\u770b\u7ba1\u7406\u955c\u50cf\u7684\u754c\u9762\uff1a<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1115.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1115.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>images\u754c\u9762\u53ef\u4ee5\u76f4\u63a5\u5220\u9664\u955c\u50cf\u548c\u76f4\u63a5pull\u955c\u50cf\u3002<\/p>\n<p>\u7ba1\u7406\u8282\u70b9\u7684\u754c\u9762\uff1a<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1116.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1116.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u53ef\u4ee5\u770b\u51fa\u7ba1\u7406\u8282\u70b9\u7684\u754c\u9762\u6807\u793a\u4e86\u8282\u70b9\u673a\u5668\u7684\u4e3b\u673a\u540d\uff0cIP\u5730\u5740\uff0c\u5bb9\u5668\u4e2a\u6570\uff0c\u5df2\u7ecf\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u7b49\u3002<\/p>\n<p>\u79c1\u6709\u4ed3\u5e93\u754c\u9762\uff0c\u53ef\u4ee5\u5728\u9875\u9762\u6dfb\u52a0\u81ea\u5df1\u7684\u79c1\u6709\u4ed3\u5e93\uff0c\u4e3a\u4ec0\u4e48\u8981\u6709\u79c1\u6709\u4ed3\u5e93\uff0c\u8fd9\u4e2a\u4e4b\u524d\u5728\u5176\u4ed6\u6587\u7ae0\u6709\u8bf4\u660e\uff0c\u56e0\u4e3a\u7f51\u7edc\uff0c\u56e0\u4e3a\u7ffb\u5899\uff0c\u56e0\u4e3a\u6d41\u91cf\uff0c\u56e0\u4e3a\u4fbf\u4e8e\u7ba1\u7406\u3002<\/p>\n<p><a href=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1117.jpg\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"has\" src=\"http:\/\/imkerwin.com\/wp-content\/uploads\/2016\/01\/1117.jpg\" alt=\"11\" \/><\/a><\/p>\n<p>\u5269\u4e0b\u7684\u7528\u6237\u7ba1\u7406\u754c\u9762\u548c\u64cd\u4f5c\u65e5\u5fd7\u8bb0\u5f55\u754c\u9762\u6211\u5c31\u4e0d\u591a\u8bf4\u4e86\uff0c\u4e00\u4e2a\u662f\u7528\u4e8e\u7ba1\u7406\u7528\u6237\u7684\uff08\u53ea\u80fd\u6dfb\u52a0\uff0c\u5220\u9664\u4e0d\u505a\u6743\u9650\u5206\u5316\u7ba1\u7406\uff09\u53e6\u5916\u4e00\u4e2a\u662f\u64cd\u4f5c\u65e5\u5fd7\u8bb0\u5f55\uff08\u53ef\u4ee5\u5220\u9664\uff0c\u91cc\u9762\u8be6\u7ec6\u8bf4\u660e\u4e86\u6bcf\u4e00\u4e2a\u9488\u5bf9\u5bb9\u5668\u548c\u955c\u50cf\u7684\u64cd\u4f5c\uff0c\u4ee5\u53ca\u662f\u8c03\u7528\u4e86\u54ea\u4e2adocker api\u64cd\u4f5c\u7684\u90fd\u6709\u8bf4\u660e\uff0c\u5341\u5206\u8be6\u7ec6\uff09\u3002<\/p>\n<p>\u8fd8\u8865\u5145\u4e00\u70b9\uff0c\u4e0a\u9762\u5fd8\u8bb0\u8bf4\u4e86\uff0c\u7ba1\u7406\u754c\u9762\u5b89\u88c5\u90e8\u7f72\u8bf4\u4e86\uff0c\u4f46\u662f\u5982\u4f55\u6dfb\u52a0\u8282\u70b9\u5462\uff1f\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>curl\u00a0-sSL https:\/\/shipyard-project.com\/deploy | ACTION=node DISCOVERY=etcd:\/\/10.0.1.10:4001bash\u00a0-s<\/p>\n<p>&nbsp;<\/p>\n<p>\u73b0\u5728\u603b\u7ed3\u4e00\u4e0bshipyard\u7684\u4f7f\u7528\u611f\u53d7\uff1a<\/p>\n<p>1.shipyard\u662f\u4e00\u4e2a\u5f88\u5f3a\u7684docker\u7ba1\u7406\u7cfb\u7edf\uff0c\u754c\u9762\u5e72\u51c0\u597d\u770b\uff0c\u5f88\u591a\u529f\u80fd\u60f3\u64cd\u4f5c\u968f\u624b\u53ef\u5f97\uff0c\u5927\u5927\u8282\u7ea6\u4e86\u67e5\u627e\u529f\u80fd\u6309\u94ae\u7684\u65f6\u95f4\u3002<\/p>\n<p>2.shipyard\u53ef\u4ee5\u7ba1\u7406\u5bb9\u5668\uff0c\u955c\u50cf\uff0c\u79c1\u6709\u4ed3\u5e93\uff0c\u8fd9\u4e2a\u9488\u5bf9docker\u7684\u751f\u6001\u5708\u7ba1\u7406\u5f88\u5168\u9762\u3002\u800c\u4e14\u529f\u80fd\u90e8\u5206\u5c01\u88c5docker api\u7528\u7684\u5f88\u7ec6\u81f4\uff0c\u5982\u521b\u5efa\u5bb9\u5668\u90a3\u91cc\u53ef\u4ee5\u770b\u51fa\u6765\uff0c\u8986\u76d6\u5f88\u5168\u9762\u4e86\u3002\u800c\u4e14\u64cd\u4f5c\u5bb9\u5668\u6700\u5e38\u7528\u7684\u90a3\u51e0\u4e2a\u529f\u80fd\u90fd\u9f50\u5168\uff0c\u521b\u5efa\u5220\u9664\u5bb9\u5668\uff0c\u6279\u91cf\u7ba1\u7406\u8282\u70b9\u5bb9\u5668\u96c6\u7fa4\uff0c\u6267\u884c\u547d\u4ee4\uff0c\u67e5\u770b\u5065\u5eb7\u72b6\u6001\u76d1\u63a7\uff0c\u4ee5\u53ca\u770b\u65e5\u5fd7\u8f93\u51fa\u3002<\/p>\n<p>3.shipyard\u7ed3\u5408\u4e86swarm\u652f\u6301\u7ba1\u7406docker\u96c6\u7fa4\uff0c\u4e0d\u5355\u5355\u53ea\u7ba1\u7406\u672c\u5730\u7684docker\u5bb9\u5668\uff0c\u8fd9\u4e2a\u5f88\u597d\u3002\u800c\u4e14\u7528shipyard\u521b\u5efa\u5bb9\u5668\u4f1a\u81ea\u52a8\u521b\u5efa\u5230\u8d44\u6e90\u76f8\u5bf9\u6d88\u8017\u5c11\u7684\u8282\u70b9\u4e0b\u9762\uff0c\u8fd9\u4e2a\u663e\u5f97\u5f88\u667a\u80fd\u3002<\/p>\n<p>4.\u4e00\u5b9a\u8981\u6311\u9009shipyard\u7684\u4e0d\u8db3\uff0c\u5c31\u662f\u5229\u7528shipyard\u521b\u5efa\u5bb9\u5668\u8017\u65f6\u76f8\u5bf9\u6765\u8bf4\u8017\u65f6\u4e00\u70b9\u3002\uff08\u8fd9\u4e2a\u5177\u4f53\u539f\u56e0\u6211\u4e5f\u4e0d\u6e05\u695a\uff0c\u603b\u611f\u89c9\u6bd4\u6211\u5728\u670d\u52a1\u5668\u91ccdocker run\u6162\uff0c\u53ef\u80fd\u662f\u8c03\u5ea6\u9009\u62e9\u7a7a\u95f2\u8282\u70b9\u7684\u65f6\u5019\u9700\u8981\u8017\u65f6\uff09<\/p>\n<p>5.shipyard\u4e0d\u80fd\u9488\u5bf9\u5177\u4f53\u7684\u8282\u70b9\u521b\u5efa\u5bb9\u5668\uff0c\u8fd9\u4e2a\u4e5f\u7b97\u4e00\u4e2a\u5c0f\u5c0f\u7684\u4e0d\u591f\u5b8c\u7f8e\u3002\u5047\u5982\u53ef\u4ee5\u9488\u5bf9\u8282\u70b9\u81ea\u5df1\u63a7\u5236\u5bb9\u5668\u8fd9\u6837\u6216\u8bb8\u66f4\u52a0\u6709\u5229\u4e8e\u6211\u4eec\u90e8\u5206\u5bf9\u7f51\u7edc\u76f8\u8fde\u6bd4\u8f83\u91cd\u8981\u7684\u9879\u76ee\u3002<\/p>\n<p>6.shipyard\u5c11\u4e86\u9488\u5bf9\u5bb9\u5668\u4e4b\u95f4\u7f51\u7edc\u7ba1\u7406\u7684\u9009\u9879\uff0c\u5047\u5982\u53ef\u4ee5\u96c6\u6210pipwork\u7ba1\u7406\u5bb9\u5668\u7f51\u7edc\u90a3\u5c31\u66f4\u5b8c\u7f8e\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u7ecf\u8fc7\u4e86\u4e00\u5468\u7684\u4f7f\u7528\uff0cshipyard\u7684\u4f18\u52bf\u662f\u538b\u5012\u6027\u80dc\u8fc7dockerui\u7684\uff0c\u800c\u4e14\u597d\u6d88\u606f\u662fshipyard\u662f\u57fa\u4e8epython django\u67b6\u6784\u5f00\u53d1\u7684\uff0c\u4e8c\u6b21\u5f00\u53d1\u5e94\u8be5\u4e0d\u96be\u3002<\/p>\n<p>\u4e0d\u8bf4\u4e86\uff0c\u6211\u5f97\u8d76\u7d27\u53bb\u628adockerui\u7ed9\u5220\u4e86\u3002- -\uff01\uff01<\/p>\n<p>\u4e2a\u4eba\u5206\u7c7b\uff1a\u00a0<a href=\"https:\/\/blog.csdn.net\/a22698488\/article\/category\/6527236\" target=\"_blank\" rel=\"nofollow noopener\">python<\/a><\/p>\n<h1><a name=\"t4\"><\/a>Docker\u8f7b\u91cf\u7ea7\u56fe\u5f62\u9875\u9762\u7ba1\u7406Portainer\u5b89\u88c5\u914d\u7f6e<\/h1>\n<p>&nbsp;<\/p>\n<h3><a name=\"t5\"><\/a>1.\u4ecb\u7ecd<\/h3>\n<p>Docker \u56fe\u5f62\u5316\u7ba1\u7406\u63d0\u4f9b\u4e86\u5f88\u591a\u5de5\u5177\uff0c\u6709Portainer\u3001Docker UI\u3001Shipyard\u7b49\u7b49\uff0c\u672c\u6587\u4e3b\u8981\u4ecb\u7ecdPortainer\u3002<\/p>\n<p>Portainer\u662f\u4e00\u4e2a\u5f00\u6e90\u3001\u8f7b\u91cf\u7ea7Docker\u7ba1\u7406\u7528\u6237\u754c\u9762\uff0c\u57fa\u4e8eDocker API\uff0c\u63d0\u4f9b\u72b6\u6001\u663e\u793a\u9762\u677f\u3001\u5e94\u7528\u6a21\u677f\u5feb\u901f\u90e8\u7f72\u3001\u5bb9\u5668\u955c\u50cf\u7f51\u7edc\u6570\u636e\u5377\u7684\u57fa\u672c\u64cd\u4f5c\uff08\u5305\u62ec\u4e0a\u4f20\u4e0b\u8f7d\u955c\u50cf\uff0c\u521b\u5efa\u5bb9\u5668\u7b49\u64cd\u4f5c\uff09\u3001\u4e8b\u4ef6\u65e5\u5fd7\u663e\u793a\u3001\u5bb9\u5668\u63a7\u5236\u53f0\u64cd\u4f5c\u3001Swarm\u96c6\u7fa4\u548c\u670d\u52a1\u7b49\u96c6\u4e2d\u7ba1\u7406\u548c\u64cd\u4f5c\u3001\u767b\u5f55\u7528\u6237\u7ba1\u7406\u548c\u63a7\u5236\u7b49\u529f\u80fd\u3002\u529f\u80fd\u5341\u5206\u5168\u9762\uff0c\u57fa\u672c\u80fd\u6ee1\u8db3\u4e2d\u5c0f\u578b\u5355\u4f4d\u5bf9\u5bb9\u5668\u7ba1\u7406\u7684\u5168\u90e8\u9700\u6c42\u3002<\/p>\n<h3><a name=\"t6\"><\/a>2.\u521b\u5efa\u5bb9\u5668<\/h3>\n<p>2.1\u4e0b\u8f7d\u5b98\u65b9\u955c\u50cf<\/p>\n<p>[root@ linuxidc \/]# docker pull portainer\/portainer<br \/>\nUsing default tag: latest<br \/>\nlatest: Pulling from portainer\/portainer<br \/>\nd1e017099d17: Pull complete<br \/>\nba5495c717cb: Pull complete<br \/>\nDigest: sha256:8146a5aae1135a0ccee424488c6867b438be21d1e915903a858d12e8382b817b<br \/>\nStatus: Downloaded newer image for portainer\/portainer:latest<\/p>\n<p>2.2\u5355\u673a\u8fd0\u884c<\/p>\n<blockquote><p>\u5982\u679c\u4ec5\u6709\u4e00\u4e2adocker\u5bbf\u4e3b\u673a\uff0c\u5219\u53ef\u4f7f\u7528\u5355\u673a\u7248\u8fd0\u884c\uff0cPortainer\u5355\u673a\u7248\u8fd0\u884c\u5341\u5206\u7b80\u5355\uff0c\u53ea\u9700\u8981\u4e00\u6761\u8bed\u53e5\u5373\u53ef\u542f\u52a8\u5bb9\u5668\uff0c\u6765\u7ba1\u7406\u8be5\u673a\u5668\u4e0a\u7684docker\u955c\u50cf\u3001\u5bb9\u5668\u7b49\u6570\u636e\u3002<\/p><\/blockquote>\n<p><strong>\u521b\u5efa\u6570\u636e\u5377\uff1a<\/strong><\/p>\n<p><strong>[root@linuxidc ~]# docker volume create portainer_data<br \/>\nportainer_data<\/strong><\/p>\n<p><strong>\u8fd0\u884c\u5bb9\u5668\uff1a<\/strong><\/p>\n<p>[root@linuxidc ~]# docker run -d -p 9000:9000 -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -v portainer_data:\/data portainer\/portainer<br \/>\n439cc8a6d44a84f5967534c50d3accc43fbeb578258a52c2683afeb230dd6e04<\/p>\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<br \/>\n-d\uff1a\u5bb9\u5668\u5728\u540e\u53f0\u8fd0\u884c\uff1b<br \/>\n-p 9000:9000 \uff1a\u5bbf\u4e3b\u673a9000\u7aef\u53e3\u6620\u5c04\u5bb9\u5668\u4e2d\u76849000\u7aef\u53e3<br \/>\n-v \/var\/run\/docker.sock:\/var\/run\/docker.sock \uff1a\u628a\u5bbf\u4e3b\u673a\u7684Docker\u5b88\u62a4\u8fdb\u7a0b(Docker daemon)\u9ed8\u8ba4\u76d1\u542c\u7684Unix\u57df\u5957\u63a5\u5b57\u6302\u8f7d\u5230\u5bb9\u5668\u4e2d\uff1b<br \/>\n-v portainer_data:\/data \uff1a\u628a\u5bbf\u4e3b\u673aportainer_data\u6570\u636e\u5377\u6302\u8f7d\u5230\u5bb9\u5668\/data\u76ee\u5f55\uff1b<\/p>\n<p><strong>\u67e5\u770b\u5bb9\u5668\u8fdb\u7a0b\uff1a<\/strong><\/p>\n<p>[root@linuxidc ~]# docker ps -l<br \/>\nCONTAINER ID\u00a0 \u00a0 \u00a0 \u00a0 IMAGE\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 COMMAND\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CREATED\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 STATUS\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 PORTS\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 NAMES<br \/>\n439cc8a6d44a\u00a0 \u00a0 \u00a0 \u00a0 portainer\/portainer\u00a0 &#8220;\/portainer&#8221;\u00a0 \u00a0 \u00a0 \u00a0 13 seconds ago\u00a0 \u00a0 \u00a0 Up 13 seconds\u00a0 \u00a0 \u00a0 0.0.0.0:9000-&gt;9000\/tcp\u00a0 amazing_clarke<\/p>\n<p><strong>\u8bbf\u95ee\u670d\u52a1\uff1a<\/strong><\/p>\n<ul>\n<li>\u8bbf\u95ee\u65b9\u5f0f\uff1ahttp:\/\/IP:9000 \uff0c\u9996\u6b21\u767b\u5f55\u9700\u8981\u6ce8\u518c\u7528\u6237\uff0c\u7ed9\u7528\u6237admin\u8bbe\u7f6e\u5bc6\u7801\uff0c\u5982\u4e0b\u56fe\uff1a<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"has\" src=\"https:\/\/www.linuxidc.com\/upload\/2018_03\/180310200329822.png\" alt=\"Docker\u8f7b\u91cf\u7ea7\u56fe\u5f62\u9875\u9762\u7ba1\u7406Portainer\u5b89\u88c5\u914d\u7f6e\" \/><\/p>\n<ul>\n<li>\u5355\u673a\u7248\u672c\u9009\u62e9\u201cLocal&#8221;\uff0c\u70b9\u51fbConnect\u5373\u53ef\u8fde\u63a5\u5230\u672c\u5730docker\uff0c\u5982\u4e0b\u56fe\uff1a<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"has\" src=\"https:\/\/www.linuxidc.com\/upload\/2018_03\/180310200329825.png\" alt=\"Docker\u8f7b\u91cf\u7ea7\u56fe\u5f62\u9875\u9762\u7ba1\u7406Portainer\u5b89\u88c5\u914d\u7f6e\" \/><br \/>\n\u6ce8\u610f\uff1a\u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u51fa\uff0c\u6709\u63d0\u793a\u9700\u8981\u6302\u8f7d\u672c\u5730 \/var\/run\/docker.socker\u4e0e\u5bb9\u5668\u5185\u7684\/var\/run\/docker.socker\u8fde\u63a5\u3002\u56e0\u6b64\uff0c\u5728\u542f\u52a8\u65f6\u5fc5\u987b\u6307\u5b9a\u8be5\u6302\u8f7d\u6587\u4ef6\u3002<\/p>\n<ul>\n<li>\u8fdb\u5165\u540e\u53ef\u4ee5\u5bf9\u5bb9\u5668\u3001\u955c\u50cf\u3001\u7f51\u7edc\u3001\u6570\u636e\u5377\u7b49\u8fdb\u884c\u7ba1\u7406\uff0c\u5982\u4e0b\u56fe\uff1a<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"has\" src=\"https:\/\/www.linuxidc.com\/upload\/2018_03\/180310200329823.png\" alt=\"Docker\u8f7b\u91cf\u7ea7\u56fe\u5f62\u9875\u9762\u7ba1\u7406Portainer\u5b89\u88c5\u914d\u7f6e\" width=\"705\" \/><\/p>\n<p>2.3\u96c6\u7fa4\u8fd0\u884c<\/p>\n<blockquote><p>\u66f4\u591a\u7684\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u4f1a\u6709\u4e00\u4e2adocker\u96c6\u7fa4\uff0c\u53ef\u80fd\u6709\u51e0\u53f0\u673a\u5668\uff0c\u4e5f\u53ef\u80fd\u6709\u51e0\u5341\u53f0\u673a\u5668\uff0c\u56e0\u6b64\uff0c\u8fdb\u884c\u96c6\u7fa4\u7ba1\u7406\u5c31\u5341\u5206\u91cd\u8981\u4e86\uff0cPortainer\u4e5f\u652f\u6301\u96c6\u7fa4\u7ba1\u7406\uff0cPortainer\u53ef\u4ee5\u548cSwarm\u4e00\u8d77\u6765\u8fdb\u884c\u96c6\u7fa4\u7ba1\u7406\u64cd\u4f5c\u3002\u9996\u5148\u8981\u642d\u5efa\u4e86\u4e00\u4e2aSwarm\uff0c\u672c\u6587\u4e0d\u7740\u91cd\u4ecb\u7ecdswarm\u96c6\u7fa4\u7684\u5b89\u88c5\u3002<\/p><\/blockquote>\n<p><strong>portainer\u96c6\u7fa4\u542f\u52a8\uff1a<\/strong><\/p>\n<ul>\n<li>\u542f\u52a8\u96c6\u7fa4\u53c2\u8003\u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/portainer.io\/install.html<\/li>\n<\/ul>\n<p>$ docker service create \\<br \/>\n&#8211;name portainer \\<br \/>\n&#8211;publish 9000:9000 \\<br \/>\n&#8211;replicas=1 \\<br \/>\n&#8211;constraint &#8216;node.role == manager&#8217; \\<br \/>\n&#8211;mount type=bind,src=\/\/var\/run\/docker.sock,dst=\/var\/run\/docker.sock \\<br \/>\n&#8211;mount type=bind,src=\/\/opt\/portainer,dst=\/data \\<br \/>\nportainer\/portainer \\<br \/>\n-H unix:\/\/\/var\/run\/docker.sock<\/p>\n<ul>\n<li>\u542f\u52a8Portainer\u4e4b\u540e\uff0c\u9996\u9875\u8fd8\u662f\u7ed9admin\u7528\u6237\u8bbe\u7f6e\u5bc6\u7801\uff08\u8fd9\u91cc\u548c\u5355\u673a\u542f\u52a8\u4e00\u6837\uff09\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"has\" src=\"https:\/\/www.linuxidc.com\/upload\/2018_03\/180310200329821.png\" alt=\"Docker\u8f7b\u91cf\u7ea7\u56fe\u5f62\u9875\u9762\u7ba1\u7406Portainer\u5b89\u88c5\u914d\u7f6e\" width=\"705\" \/><\/p>\n<ul>\n<li>\u8fdb\u5165\u540e\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u4f1a\u53d1\u73b0\u591a\u4e86\u5173\u4e8eswarm\u7684\u9009\u9879\uff0c\u5176\u5b83\u914d\u7f6e\u548c\u5355\u673a\u8fd0\u884c\u7684portainer\u4e00\u6837\uff0c\u90fd\u5f88\u7b80\u5355\uff1a<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"has\" src=\"https:\/\/www.linuxidc.com\/upload\/2018_03\/180310200329824.png\" alt=\"Docker\u8f7b\u91cf\u7ea7\u56fe\u5f62\u9875\u9762\u7ba1\u7406Portainer\u5b89\u88c5\u914d\u7f6e\" width=\"705\" \/><\/p>\n<ul>\n<li>Portainer\u7684\u57fa\u672c\u64cd\u4f5c\u5c31\u8fd9\u4e48\u591a\uff0c\u5177\u4f53\u7684\u64cd\u4f5c\u6b65\u9aa4\u8fd8\u9700\u8981\u5927\u5bb6\u81ea\u5df1\u53bb\u5b66\u4e60\u7406\u89e3\u3002<\/li>\n<\/ul>\n<h3><a name=\"t7\"><\/a>3.\u53c2\u8003\u94fe\u63a5<\/h3>\n<p>\u5b98\u65b9\u7f51\u7ad9\uff1ahttps:\/\/portainer.io\/<br \/>\n\u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/portainer.readthedocs.io\/<br \/>\n\u6f14\u793a\u7f51\u5740\uff1ahttp:\/\/demo.portainer.io \u8d26\u53f7admin \u5bc6\u7801 tryportainer<\/p>\n<p><strong>\u66f4\u591aDocker\u76f8\u5173\u6559\u7a0b\u89c1\u4ee5\u4e0b\u5185\u5bb9<\/strong>\uff1a<\/p>\n<p>Docker\u5b89\u88c5\u5e94\u7528(<a href=\"https:\/\/www.linuxidc.com\/topicnews.aspx?tid=14\" target=\"_blank\" rel=\"nofollow noopener\">CentOS<\/a>\u00a06.5_x64)\u00a0<a href=\"https:\/\/www.linuxidc.com\/Linux\/2014-07\/104595.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2014-07\/104595.htm<\/a><br \/>\n<a href=\"https:\/\/www.linuxidc.com\/topicnews.aspx?tid=2\" target=\"_blank\" rel=\"nofollow noopener\">Ubuntu<\/a>\u00a016.04 \u670d\u52a1\u5668\u4e0a\u914d\u7f6e\u4f7f\u7528 Docker\u00a0\u00a0<a href=\"https:\/\/www.linuxidc.com\/Linux\/2017-06\/145176.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2017-06\/145176.htm<\/a><br \/>\nUbuntu 15.04\u4e0b\u5b89\u88c5Docker\u00a0\u00a0<a href=\"https:\/\/www.linuxidc.com\/Linux\/2015-07\/120444.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2015-07\/120444.htm<\/a><br \/>\nDocker \u5b89\u88c5\u5b9e\u4f8b\u00a0<a href=\"https:\/\/www.linuxidc.com\/Linux\/2017-04\/142666.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2017-04\/142666.htm<\/a><br \/>\nDocker \u521b\u5efa\u57fa\u7840\u955c\u50cf\u00a0\u00a0<a href=\"https:\/\/www.linuxidc.com\/Linux\/2017-05\/144112.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2017-05\/144112.htm<\/a><br \/>\n\u5728 Ubuntu 15.04 \u4e0a\u5982\u4f55\u5b89\u88c5Docker\u53ca\u57fa\u672c\u7528\u6cd5\u00a0<a href=\"https:\/\/www.linuxidc.com\/Linux\/2015-09\/122885.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2015-09\/122885.htm<\/a><br \/>\nUbuntu 16.04\u4e0aDocker\u4f7f\u7528\u624b\u8bb0\u00a0<a href=\"https:\/\/www.linuxidc.com\/Linux\/2016-12\/138490.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2016-12\/138490.htm<\/a><br \/>\n\u4f7f\u7528Docker\u5206\u5206\u949f\u542f\u52a8\u5e38\u7528\u5e94\u7528\u00a0\u00a0<a href=\"https:\/\/www.linuxidc.com\/Linux\/2017-04\/142649.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2017-04\/142649.htm<\/a><br \/>\nUbuntu 16.04\u4e0bDocker\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u4e0d\u751f\u6548\u89e3\u51b3\u529e\u6cd5\u00a0\u00a0<a href=\"https:\/\/www.linuxidc.com\/Linux\/2017-05\/143862.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2017-05\/143862.htm<\/a><\/p>\n<p><strong>Docker \u7684\u8be6\u7ec6\u4ecb\u7ecd<\/strong>\uff1a<a href=\"https:\/\/www.linuxidc.com\/Linux\/2013-10\/91050.htm\" target=\"_blank\" rel=\"nofollow noopener\">\u8bf7\u70b9\u8fd9\u91cc<\/a><br \/>\n<strong>Docker \u7684\u4e0b\u8f7d\u5730\u5740<\/strong>\uff1a<a href=\"https:\/\/www.linuxidc.com\/down.aspx?id=1020\" target=\"_blank\" rel=\"nofollow noopener\">\u8bf7\u70b9\u8fd9\u91cc<\/a><\/p>\n<p><strong>\u672c\u6587\u6c38\u4e45\u66f4\u65b0\u94fe\u63a5\u5730\u5740<\/strong>\uff1a<a href=\"https:\/\/www.linuxidc.com\/Linux\/2018-03\/151307.htm\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.linuxidc.com\/Linux\/2018-03\/151307.htm<\/a><\/p>\n<\/div>\n<\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>DOCKER\u56fe\u5f62\u9875\u9762\u7ba1\u7406\u5de5\u5177&#038;#8211<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[122],"class_list":["post-2750","post","type-post","status-publish","format-standard","hentry","tag-06-godocker"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/2750","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=2750"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/2750\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=2750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=2750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=2750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}