{"id":727,"date":"2016-12-09T17:40:22","date_gmt":"2016-12-09T09:40:22","guid":{"rendered":"http:\/\/www.sulabs.net\/?p=727"},"modified":"2020-08-28T18:26:29","modified_gmt":"2020-08-28T10:26:29","slug":"docker%e5%8f%8a%e5%9b%be%e5%bd%a2%e5%8d%95%e6%9c%ba%e7%ae%a1%e7%90%86%e5%b7%a5%e5%85%b7portainerdockerui%e9%83%a8%e7%bd%b2","status":"publish","type":"post","link":"https:\/\/www.sulabs.net\/?p=727","title":{"rendered":"Docker\u53ca\u56fe\u5f62\u5355\u673a\u7ba1\u7406\u5de5\u5177Portainer(dockerui)\u90e8\u7f72"},"content":{"rendered":"<p>\u4ececentos7\u5f00\u59cbyum\u6e90\u9ed8\u8ba4\u5df2\u5305\u542b\u4e86docker\u652f\u6301\uff0c\u5b89\u88c5\u4f7f\u7528\u975e\u5e38\u7b80\u5355.<br \/>\n\u7cfb\u7edf\u73af\u5883\uff1aCentOS7 1511 &nbsp;4CPU \/ 4G<\/p>\n<p>1.\u5b89\u88c5Docker<br \/>\n# yum install docker -y<br \/>\n# docker --version<br \/>\nDocker version 1.10.3, build cb079f6-unsupported<br \/>\n\/\/\u786e\u8ba4\u7248\u672c\u4fe1\u606f<br \/>\n<!--more--><\/p>\n<p>2.\u4ece\u963f\u91cc\u4e91\u514d\u8d39\u5185\u521b\u5efa\u4e00\u4e2a\u52a0\u901f\u5668\u5730\u5740\uff0c\u4fbf\u4e8eDocker\u7ba1\u7406\u7ef4\u62a4\u955c\u50cf<br \/>\n\u53bb&nbsp;https:\/\/dev.aliyun.com \u963f\u91cc\u4e91\u5e73\u53f0\u7533\u8bf7\u4e00\u4e2a\u56fd\u5185\u5bb9\u5668\u955c\u50cf\u52a0\u901f\u5668\u670d\u52a1\uff0c\u6210\u529f\u540e\u5f97\u5230\u4e00\u4e2a\u52a0\u901f\u5668\u5730\u5740<\/p>\n<p><a href=\"https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/QQ\u622a\u56fe20161209172029.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-728 alignnone\" src=\"https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/QQ\u622a\u56fe20161209172029.jpg\" alt=\"\" width=\"802\" height=\"474\" srcset=\"https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/QQ\u622a\u56fe20161209172029.jpg 802w, https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/QQ\u622a\u56fe20161209172029-300x177.jpg 300w, https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/QQ\u622a\u56fe20161209172029-768x454.jpg 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/p>\n<p>3.\u914d\u7f6eDocker \u52a0\u901f\u5668\u5730\u5740<br \/>\n# vim \/etc\/sysconfig\/docker<br \/>\n\u4fee\u6539OPTIONS\u53c2\u6570\uff0c\u6dfb\u52a0\u4e00\u4e2aRegistry-mirror\u955c\u50cf\u5730\u5740<br \/>\n--registry-mirror=https:\/\/xalt2mdt.mirror.aliyuncs.com<\/p>\n<p>4.\u542f\u52a8Docker\u670d\u52a1<br \/>\n# systemctl start docker.service<\/p>\n<p>5.\u83b7\u53d6portainer \u955c\u50cf<br \/>\n#&nbsp;docker pull portainer\/portainer &nbsp;<br \/>\n# docker images<br \/>\nREPOSITORY TAG IMAGE ID CREATED SIZE<br \/>\ndocker.io\/portainer\/portainer latest 970fff9efb0a 13 days ago 10.69 MB<br \/>\n\/\/ \u67e5\u770b\u955c\u50cf<\/p>\n<p>6.\u542f\u52a8portainer \u5bb9\u5668<br \/>\n# docker run -d -p 9000:9000 -v \/var\/run\/docker.sock:\/var\/run\/docker.sock portainer\/portainer<br \/>\n-d \u53c2\u6570\u4ee5detach\u65b9\u5f0f\u8fd0\u884c<br \/>\n-p \u5c06\u5bb9\u5668\u5de5\u4f5c\u7aef\u53e3\u6620\u5c04\u81f3\u7269\u7406\u673a\u7aef\u53e3 HOST\u7aef\u53e3:\u5bb9\u5668\u7aef\u53e3<br \/>\n-v \u5c06\u5bb9\u5668\u76ee\u5f55\u6302\u8f7d(\u6620\u5c04)\u5230\u7269\u7406\u673a\u5bf9\u5e94\u4f4d\u7f6e,\u8fd9\u91cc\u6307\u5b9a\u901a\u8baf\u65b9\u5f0f\u4e3asock<br \/>\nportainer\/portainer \u4e3a\u955c\u50cf\u540d\u79f0<\/p>\n<p>portainner \u4e5f\u652f\u6301\u7528TCP\u901a\u8baf\uff0c\u542f\u52a8\u547d\u4ee4<br \/>\n# docker run -d -p 9000:9000 portainer\/portainer -H tcp:\/\/&lt;REMOTE_HOST&gt;:&lt;REMOTE_PORT&gt;<\/p>\n<p>7.\u8bbf\u95ee\u7ba1\u7406\u754c\u9762<br \/>\nhttp:\/\/\u4e3b\u673aIP:9000&nbsp;<br \/>\n<a href=\"https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/20161209173435.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-729 alignnone\" src=\"https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/20161209173435.png\" alt=\"\" width=\"1253\" height=\"821\" srcset=\"https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/20161209173435.png 1253w, https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/20161209173435-300x197.png 300w, https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/20161209173435-768x503.png 768w, https:\/\/www.sulabs.net\/wp-content\/uploads\/2016\/12\/20161209173435-1024x671.png 1024w\" sizes=\"auto, (max-width: 1253px) 100vw, 1253px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ececentos7\u5f00\u59cbyum\u6e90\u9ed8\u8ba4\u5df2\u5305\u542b\u4e86docker\u652f\u6301\uff0c\u5b89\u88c5\u4f7f\u7528\u975e\u5e38\u7b80\u5355. \u7cfb &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/www.sulabs.net\/?p=727\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[106],"tags":[],"class_list":["post-727","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts\/727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=727"}],"version-history":[{"count":5,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts\/727\/revisions"}],"predecessor-version":[{"id":962,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts\/727\/revisions\/962"}],"wp:attachment":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}