{"id":1761,"date":"2016-08-06T22:04:47","date_gmt":"2016-08-06T14:04:47","guid":{"rendered":"https:\/\/blog.vimge.com\/?p=1761"},"modified":"2017-06-07T22:09:05","modified_gmt":"2017-06-07T14:09:05","slug":"docker-note-common-command","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/architecture\/docker-note-common-command.html","title":{"rendered":"Docker\u5b66\u4e60\u7b14\u8bb0\uff1a\u5e38\u7528\u547d\u4ee4"},"content":{"rendered":"

Usage: docker search [OPTIONS] TERM
\n$docker search -s 3 centos
\n\u641c\u7d22\u547d\u4ee4\uff0c\u53c2\u6570 -s \u6307\u5b9a\u955c\u50cf\u8bc4\u4ef7\u661f\u7ea7<\/p>\n

Usage: docker pull [OPTIONS] NAME[:TAG|@DIGEST]
\n$docker pull centos:centos6.8
\n\u4ece\u9ed8\u8ba4\u955c\u50cf\u6e90\u4e0b\u8f7d\u955c\u50cf\uff0cdocker pull NAME[:TAG]\uff0c\u5176\u4e2dNAME\u662f\u955c\u50cf\u4ed3\u5e93\u540d\u79f0\uff08\u7528\u6765\u533a\u5206\u955c\u50cf\uff09\uff0cTAG\u662f\u955c\u50cf\u6807\u7b7e\uff08\u5f80\u5f80\u7528\u6765\u8868\u793a\u7248\u672c\uff09\uff0c\u4e0d\u6307\u5b9aTAG\u5219\u62c9\u53d6 latest \u6807\u7b7e\u955c\u50cf\uff0c\u955c\u50cf\u4ed3\u5e93\u540d\u79f0\u524d\u9762\u53ef\u4ee5\u6dfb\u52a0\u4ed3\u5e93\u5730\u5740\u4ece\u6307\u5b9a\u4ed3\u5e93\u4e0b\u8f7d<\/p>\n

Usage: docker images [OPTIONS] [REPOSITORY[:TAG]]
\n$docker images
\n\u67e5\u770b\u672c\u5730\u955c\u50cf\u5217\u8868<\/p>\n

Usage: docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
\n$docker tag 0cd centos:ali
\n\u6ce8\u610f\u6e90\u955c\u50cf\u4f7f\u7528ID\u4f5c\u4e3a\u53c2\u6570\uff0c\u76ee\u7684\u955c\u50cf\u5982\u679c\u4e0d\u4f20\u53c2\u6570TAG\u7684\u8bdd\u5219\u6807\u7b7e\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u503clatest<\/p>\n

Usage: docker inspect [OPTIONS] NAME|ID [NAME|ID…]
\n\u83b7\u53d6\u955c\u50cf\u8be6\u7ec6\u4fe1\u606f<\/p>\n

Usage: docker rmi [OPTIONS] IMAGE [IMAGE…]
\n\u5220\u9664\u4e00\u4e2a\u6216\u591a\u4e2a\u955c\u50cf\uff0c\u5176\u4e2d\u955c\u50cf\u9700\u8981\u6307\u5b9a\u660e\u786e\uff0c\u5982\u679c\u53ea\u6307\u5b9a\u955c\u50cf\u4e0d\u6307\u5b9a\u6807\u7b7e\u5219\u9ed8\u8ba4\u5220\u9664 latest\u6807\u7b7e\u955c\u50cf\uff0c\u53ef\u4ee5\u4f7f\u955c\u50cfID\uff0c\u955c\u50cf\u53ea\u6709\u5728\u6240\u6709\u6807\u7b7e\u90fd\u88ab\u5220\u9664\u7684\u65f6\u5019\u624d\u4f1a\u88ab\u5220\u9664\uff0c\u955c\u50cf\u5b58\u5728\u5bb9\u5668\u7684\u65f6\u5019\u4e5f\u4e0d\u80fd\u88ab\u5220\u9664<\/p>\n

Usage: docker create [OPTIONS] IMAGE [COMMAND] [ARG…]
\n$docker create -it –name=”create_2″ centos:centos6.8
\n\u521b\u5efa\u5bb9\u5668\uff0c\u4e0d\u9a6c\u4e0a\u542f\u52a8<\/p>\n

Usage: docker start [OPTIONS] CONTAINER [CONTAINER…]
\ndocker start -it 3ca<\/p>\n

\u542f\u52a8\u5bb9\u5668<\/p>\n

Usage: docker stop [OPTIONS] CONTAINER [CONTAINER…]
\n\u5173\u505c\u4e00\u4e2a\u5bb9\u5668<\/p>\n

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG…]
\n$docker run -it –name=”run_test” centos:centos6.8 \/bin\/bash
\n\u521b\u5efa\u5e76\u542f\u52a8\u5bb9\u5668<\/p>\n

Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG…]
\n$docker exec -it 1aab \/bin\/bash
\n\u8fdb\u5165\u4e00\u4e2a\u5728\u540e\u53f0\u8fd0\u884c\u7684\u5bb9\u5668<\/p>\n","protected":false},"excerpt":{"rendered":"

Usage: docker search [OPTIONS] TERM $docker search -s 3 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[156],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1761"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1761"}],"version-history":[{"count":1,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1761\/revisions"}],"predecessor-version":[{"id":1762,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1761\/revisions\/1762"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}