{"id":2242,"date":"2020-08-27T11:34:53","date_gmt":"2020-08-27T03:34:53","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=2242"},"modified":"2022-11-19T22:27:38","modified_gmt":"2022-11-19T14:27:38","slug":"docker-for-windows","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=2242","title":{"rendered":"[docker]\u8fd0\u884ccentos"},"content":{"rendered":"\n<p>\u4e00\u3001\u5b89\u88c5\u5305\u4e0b\u8f7d<br><a href=\"https:\/\/www.docker.com\/products\/docker-desktop\">https:\/\/www.docker.com\/products\/docker-desktop<\/a> <\/p>\n\n\n\n<p>\u4e8c\u3001\u5728BIOS\u4e2d\u542f\u52a8VT\u6280\u672f<\/p>\n\n\n\n<p>\u4e09\u3001\u88c5\u5b8c\u4e4b\u540e\uff0c\u91cd\u542fWindows\uff0c\u7136\u540e\u6253\u5f00cmd\u6216\u8005Powershell\uff0c\u5373\u53ef\u8f93\u5165docker\u547d\u4ee4<\/p>\n\n\n\n<p>\u56db\u3001\u62c9\u53d6centos\u5305<br>docker pull centos:7<br>pull\u4e3a\u62c9\u53d6\uff0ccentos\u4e3a\u5305\u540d\uff0c:7 \u4e3a\u7248\u672c\u53f7<br>rmi\u4e3a\u5220\u9664\u955c\u50cf\uff0cdocker rmi IMAGEID<\/p>\n\n\n\n<p>\u4e94\u3001\u67e5\u770b\u5305<br>docker images<\/p>\n\n\n\n<p>\u516d\u3001\u8fd0\u884c\u5bb9\u5668<br> docker run -itd (-p  \u4e3b\u673a\u7aef\u53e3:\u5bb9\u5668\u7aef\u53e3 IMAGEID) \/bin\/bash <br><br>\u4e5f\u53ef\u4ee5\u6302\u8f7d\u672c\u673a\u78c1\u76d8\u5230 \u76ee\u6807\u5bb9\u5668\u4e2d, -v Host:Docker\uff0c\u4f8b\u5982<br>docker run -itd -p 80:80 -v d:\\:\/soft myimage \/bin\/bash\uff0c \u628a\u5219\u672c\u673aD\u76d8\u6620\u5c04\u5230\u76ee\u6807\u7684\/soft\u4e2d<\/p>\n\n\n\n<p>\u4e03\u3001\u8fdb\u5165\u5bb9\u5668<br>docker attach   CONTAINERID  <br>\u6216<br>docker&nbsp;ps<br>docker&nbsp;exec&nbsp;-it&nbsp; CONTAINERID  \/bin\/bash<\/p>\n\n\n\n<p>\u516b\u3001\u4fdd\u5b58\u5bb9\u5668\u7684\u4fee\u6539<br>docker ps -l<br>docker commit CONTAINERID myname<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<ul><li>centos\u5b89\u88c5nginx<br>\u4e0b\u8f7d <a href=\"http:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo\">http:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo<\/a><br>\u8986\u76d6\/etc\/yum.repos.d\/CentOS-Base.repo<br>\u7136\u540e\u8fd0\u884c\uff1a<br>yum clean&nbsp;all <br>yum makecache <br>yum&nbsp;install&nbsp;epel-release <br>yum install nginx <\/li><\/ul>\n\n\n\n<ul><li>\u5fc5\u8981\u5305\u5b89\u88c5<\/li><li>ifconfig\uff1ayum&nbsp;install&nbsp;net-tools&nbsp;<\/li><li>lsof\uff1ayum install lsof<\/li><li>wget: yum install wget<\/li><\/ul>\n\n\n\n<p>\u4e5d\u3001\u5728Centos\u4e2d\u542f\u52a8 Docker<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service docker start<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5b89\u88c5\u5305\u4e0b\u8f7dhttps:\/\/www.docker.com\/products\/docker-desktop \u4e8c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/2242"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2242"}],"version-history":[{"count":21,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/2242\/revisions"}],"predecessor-version":[{"id":4608,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/2242\/revisions\/4608"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}