{"id":186992,"date":"2020-10-25T01:51:13","date_gmt":"2020-10-24T17:51:13","guid":{"rendered":"http:\/\/4563.org\/?p=186992"},"modified":"2020-10-25T01:51:13","modified_gmt":"2020-10-24T17:51:13","slug":"docker-%e6%89%80%e6%9c%89%e5%91%bd%e4%bb%a4%e4%b8%80%e8%a7%88","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=186992","title":{"rendered":"Docker \u6240\u6709\u547d\u4ee4\u4e00\u89c8"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Docker \u6240\u6709\u547d\u4ee4\u4e00\u89c8               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : haicoderibai <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h1>Docker \u547d\u4ee4\u6982\u8ff0<\/h1>\n<p> <\/p>\n<h2>Docker \u73af\u5883\u4fe1\u606f<\/h2>\n<p><strong>docker info<\/strong> \u67e5\u770b\u5bb9\u5668\u57fa\u672c\u4fe1\u606f\u3002 <strong>docker version<\/strong> \u67e5\u770b\u5bb9\u5668\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<h2>Docker \u5bb9\u5668\u751f\u547d\u5468\u671f\u7ba1\u7406<\/h2>\n<p><strong>docker create<\/strong> \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bb9\u5668\uff0c\u4f46\u4e0d\u542f\u52a8\u5b83\u3002\u7c7b\u4f3c docker run \u547d\u4ee4\u3002<br \/> <strong>docker exec<\/strong> \u5728\u8fd0\u884c\u7684 Docker \u5bb9\u5668\u4e2d\u6267\u884c\u4e00\u6761\u547d\u4ee4\u3002<br \/> <strong>docker run<\/strong> \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bb9\u5668\uff0c\u5e76\u8fd0\u884c\u5b83\uff0c\u533a\u522b\u4e8e docker create \u547d\u4ee4\u3002<br \/> <strong>docker start<\/strong> \u542f\u52a8\u4e00\u4e2a\u6216\u591a\u4e2a\u5df2\u7ecf\u88ab\u505c\u6b62\u7684\u5bb9\u5668\uff0c\u533a\u522b\u4e8e docker run \u547d\u4ee4\u3002 <strong>docker stop<\/strong> \u505c\u6b62\u4e00\u4e2a\u8fd0\u884c\u4e2d\u7684\u5bb9\u5668\u3002<br \/> <strong>docker restart<\/strong> \u91cd\u542f\u5bb9\u5668\u3002<br \/> <strong>docker kill<\/strong> \u6740\u6389\u4e00\u4e2a\u8fd0\u884c\u4e2d\u7684\u5bb9\u5668\u3002<br \/> <strong>docker rm<\/strong> \u5220\u9664\u5bb9\u5668\u3002<br \/> <strong>docker pause<\/strong> \u6682\u505c\u4e00\u4e2a\u6216\u591a\u4e2a Docker \u5bb9\u5668\u7684\u6240\u6709\u8fdb\u7a0b\u3002<br \/> <strong>docker unpause<\/strong> \u6062\u590d\u5bb9\u5668\u4e2d\u6240\u6709\u7684\u8fdb\u7a0b\u3002<\/p>\n<h3>Docker \u5bb9\u5668\u64cd\u4f5c\u8fd0\u7ef4<\/h3>\n<p><strong>docker ps<\/strong> \u5217\u51fa\u5bb9\u5668\u3002<br \/> <strong>docker inspect<\/strong> \u83b7\u53d6\u5bb9\u5668 \/\u955c\u50cf\u7684\u5143\u6570\u636e\u3002<br \/> <strong>docker top<\/strong> \u663e\u793a\u5bb9\u5668\u4e2d\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002<br \/> <strong>docker attach<\/strong> \u8fdb\u5165\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684 Docker \u5bb9\u5668\u3002<br \/> <strong>docker wait<\/strong> \u7528\u4e8e\u963b\u585e\u4e00\u4e2a\u6216\u591a\u4e2a\u5bb9\u5668\u76f4\u5230\u5bb9\u5668\u505c\u6b62\uff0c\u7136\u540e\u6253\u5370\u9000\u51fa\u4ee3\u7801\u3002<br \/> <strong>docker export<\/strong> \u5c06\u5bb9\u5668\u91cc\u7684\u6587\u4ef6\u7cfb\u7edf\u4f5c\u4e3a\u4e00\u4e2a tar \u5f52\u6863\u6587\u4ef6\u5bfc\u51fa\u5230\u6807\u51c6\u8f93\u51fa\u3002<br \/> <strong>docker port<\/strong> \u5217\u51fa\u6307\u5b9a\u7684\u5bb9\u5668\u7684\u7aef\u53e3\u6620\u5c04\uff0c\u6216\u8005\u5c06\u5bb9\u5668\u91cc\u7684\u7aef\u53e3\u6620\u5c04\u5230\u5bbf\u4e3b\u673a\u3002 <strong>docker rename<\/strong> \u91cd\u547d\u540d\u4e00\u4e2a\u5bb9\u5668\u3002<br \/> <strong>docker stats<\/strong> \u52a8\u6001\u663e\u793a\u5bb9\u5668\u7684\u8d44\u6e90\u6d88\u8017\u60c5\u51b5,\u5305\u62ec:CPU \u3001\u5185\u5b58\u3001\u7f51\u7edc I\/O \u3002<br \/> <strong>docker update<\/strong> \u66f4\u65b0\u4e00\u4e2a\u6216\u591a\u4e2a Docker \u5bb9\u5668\u7684\u914d\u7f6e\u3002<\/p>\n<h3>Docker \u5bb9\u5668 rootfs \u547d\u4ee4<\/h3>\n<p><strong>docker commit<\/strong> \u6839\u636e Docker \u5bb9\u5668\u7684\u66f4\u6539\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Dokcer \u955c\u50cf\u3002<br \/> <strong>docker cp<\/strong> \u5728\u672c\u5730\u6587\u4ef6\u7cfb\u7edf\u4e0e Dokcer \u5bb9\u5668\u4e4b\u95f4\u590d\u5236\u6587\u4ef6\u6216\u8005\u6587\u4ef6\u5939\u3002 <strong>docker diff<\/strong> \u7528\u4e8e\u6bd4\u8f83\u4e00\u4e2a Docker \u5bb9\u5668\u4e0d\u540c\u7248\u672c\u63d0\u4ea4\u7684\u6587\u4ef6\u5dee\u5f02\u3002<\/p>\n<h3>Docker \u955c\u50cf\u4ed3\u5e93\u547d\u4ee4<\/h3>\n<p><strong>docker login<\/strong> \u767b\u5f55 Docker registry \u3002<br \/> <strong>docker logout<\/strong> \u767b\u51fa Docker registry \u3002<br \/> <strong>docker pull<\/strong> \u62c9\u53d6\u4e00\u4e2a Docker \u955c\u50cf\u6216\u4ed3\u5e93\u5230 registry \u3002 <strong>docker push<\/strong> \u63a8\u9001\u4e00\u4e2a Docker \u955c\u50cf\u6216\u4ed3\u5e93\u5230 registry \u3002<br \/> <strong>docker search<\/strong> \u5728 Docker Hub \u4e2d\u641c\u7d22 Dokcer \u955c\u50cf\u3002<\/p>\n<h3>Docker \u672c\u5730\u955c\u50cf\u7ba1\u7406<\/h3>\n<p><strong>docker build<\/strong> \u6839\u636e Dockerfile \u6587\u4ef6\u6784\u5efa\u4e00\u4e2a Docker \u955c\u50cf\u3002 <strong>docker images<\/strong> \u5217\u51fa Docker \u955c\u50cf\u3002<br \/> <strong>docker rmi<\/strong> \u5220\u9664\u4e00\u4e2a\u6216\u591a\u4e2a Docker \u955c\u50cf\u3002<br \/> <strong>docker tag<\/strong> \u4e3a Docker \u955c\u50cf\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6807\u7b7e\u3002<br \/> <strong>docker save<\/strong> \u5c06 Docker \u955c\u50cf\u4fdd\u5b58\u6210 tar \u5305\u3002<br \/> <strong>docker import<\/strong> \u4ece\u4e00\u4e2a tar \u6587\u4ef6\u521b\u5efa\u4e00\u4e2a Docker \u955c\u50cf\u3002<br \/> <strong>docker load<\/strong> \u4ece tar \u5305\u6216\u8005\u6807\u51c6\u8f93\u5165\u52a0\u8f7d Docker \u955c\u50cf\u3002<\/p>\n<h3>Docker \u5bb9\u5668\u8d44\u6e90\u7ba1\u7406<\/h3>\n<p>docker volume \u7ba1\u7406 Docker \u5377\u3002<br \/> docker network \u7ba1\u7406 Docker \u7f51\u7edc\u3002<\/p>\n<h3>Docker \u7cfb\u7edf\u65e5\u5fd7\u4fe1\u606f<\/h3>\n<p><strong>docker events<\/strong> \u7528\u4e8e\u6253\u5370\u51fa\u5b9e\u65f6\u7684\u7cfb\u7edf\u4e8b\u4ef6\u3002<br \/> <strong>docker history<\/strong> \u6253\u5370\u51fa\u6307\u5b9a\u7684 Docker \u955c\u50cf\u7684\u5386\u53f2\u7248\u672c\u4fe1\u606f\u3002 <strong>docker logs<\/strong> \u6253\u5370 Docker \u5bb9\u5668\u7684\u65e5\u5fd7\u3002<\/p>\n<p>\u539f\u6587\u5730\u5740\uff1a<\/p>\n<p>\u55e8\u5ba2\u7f51<\/p>\n<p>\u67e5\u770b\u66f4\u591a\u6587\u7ae0\uff0c\u53ef\u4ee5\u5173\u6ce8\u4e0b\u65b9\u516c\u4f17\u53f7<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/11\/20201109_5fa8cc8145401.png\" alt=\"Docker \u6240\u6709\u547d\u4ee4\u4e00\u89c8\" \/><\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Docker \u6240\u6709\u547d\u4ee4\u4e00\u89c8 \u8cc7\u6df1\u5927&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/186992"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=186992"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/186992\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=186992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=186992"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=186992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}