{"id":924,"date":"2018-05-22T11:53:00","date_gmt":"2018-05-22T03:53:00","guid":{"rendered":"http:\/\/www.langmanezhuang.com\/index.php\/2018\/05\/22\/docker%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4-%e5%ae%b9%e5%99%a8%e7%ae%a1%e7%90%86-%e9%95%9c%e5%83%8f%e7%ae%a1%e7%90%86\/"},"modified":"2018-05-22T11:53:00","modified_gmt":"2018-05-22T03:53:00","slug":"docker%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4-%e5%ae%b9%e5%99%a8%e7%ae%a1%e7%90%86-%e9%95%9c%e5%83%8f%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"http:\/\/blog.langmanezhuang.com\/index.php\/2018\/05\/22\/docker%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4-%e5%ae%b9%e5%99%a8%e7%ae%a1%e7%90%86-%e9%95%9c%e5%83%8f%e7%ae%a1%e7%90%86\/","title":{"rendered":"Docker\u5e38\u7528\u547d\u4ee4 \u5bb9\u5668\u7ba1\u7406  \u955c\u50cf\u7ba1\u7406"},"content":{"rendered":"<p>#\u67e5\u770b\u5bb9\u5668ID(containedId)<br \/>  $docker ps -a<\/p>\n<p>#\u5220\u9664\u5bb9\u5668<br \/>   $docker rm containedId<\/p>\n<p>#\u505c\u6b62\u8fd0\u884c\u7684\u5bb9\u5668<br \/>   $docker stop containedId<\/p>\n<p>#\u4fee\u6539\u5bb9\u5668\u540e\u5c06\u5bb9\u5668\u4fdd\u5b58\u6210\u955c\u50cf<br \/>   $docker commit containedId supermap9d:v1<\/p>\n<p>#\u521b\u5efa\u5bb9\u5668\u5e76\u8fdb\u5165\u4ea4\u4e92\u5f0f\u6a21\u5f0f<br \/>   $docker run -it registry:versionid \/bin\/bash<\/p>\n<p>#\u67e5\u770b\u955c\u50cf<br \/>   $docker images<\/p>\n<p>#\u5220\u9664\u955c\u50cf<br \/>   $docker rmi imageid  \u6216\u5219 docker rmi registry:versionid<\/p>\n<p>&nbsp;<\/p>\n<p>\u4f7f\u7528docker\u955c\u50cfnginx:latest\u4ee5\u540e\u53f0\u6a21\u5f0f\u542f\u52a8\u4e00\u4e2a\u5bb9\u5668,\u5e76\u5c06\u5bb9\u5668\u547d\u540d\u4e3amynginx\u3002<\/p>\n<div class=\"cnblogs_Highlighter\">\n<pre class=\"brush:bash;gutter:true;\">docker run --name mynginx -d nginx:latest\n<\/pre>\n<\/div>\n<p>\u3000<\/p>\n<p>\u4f7f\u7528\u955c\u50cf nginx:latest\uff0c\u4ee5\u540e\u53f0\u6a21\u5f0f\u542f\u52a8\u4e00\u4e2a\u5bb9\u5668,\u5c06\u5bb9\u5668\u7684 80 \u7aef\u53e3\u6620\u5c04\u5230\u4e3b\u673a\u7684 80 \u7aef\u53e3,\u4e3b\u673a\u7684\u76ee\u5f55 \/data \u6620\u5c04\u5230\u5bb9\u5668\u7684 \/data\u3002<\/p>\n<p>&nbsp;<\/p>\n<div class=\"cnblogs_Highlighter\">\n<pre class=\"brush:bash;gutter:true;\">docker run -p 80:80 -v \/data:\/data -d nginx:latest\n<\/pre>\n<\/div>\n<p>\u3000\u3000<\/p>\n<p>\u7ed1\u5b9a\u5bb9\u5668\u7684 8080 \u7aef\u53e3\uff0c\u5e76\u5c06\u5176\u6620\u5c04\u5230\u672c\u5730\u4e3b\u673a 127.0.0.1 \u7684 80 \u7aef\u53e3\u4e0a\u3002<\/p>\n<p>&nbsp;<\/p>\n<div class=\"cnblogs_Highlighter\">\n<pre class=\"brush:bash;gutter:true;\">docker run -p 127.0.0.1:80:8080\/tcp ubuntu bash\n<\/pre>\n<\/div>\n<p>\u3000\u3000<\/p>\n<p>\u4f7f\u7528\u955c\u50cfnginx:latest\u4ee5\u4ea4\u4e92\u6a21\u5f0f\u542f\u52a8\u4e00\u4e2a\u5bb9\u5668,\u5728\u5bb9\u5668\u5185\u6267\u884c\/bin\/bash\u547d\u4ee4\u3002<\/p>\n<div class=\"cnblogs_Highlighter\">\n<pre class=\"brush:bash;gutter:true;\">runoob@runoob:~$ docker run -it nginx:latest \/bin\/bash\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>#\u4e3b\u673a\u590d\u5236\u6587\u4ef6\u5230docker\u7684[\/path]\u8def\u5f84<br \/>   $docker cp localhostfile containedId:\/path<\/p>\n<p>#\u767b\u5f55\u963f\u91cc\u4e91docker registry:<br \/>  $docker login &#8211;username=610152753@qq.com registry.cn-hangzhou.aliyuncs.com   \u5bc6\u7801:Ak610152753<\/p>\n<p>#\u767b\u5f55registry\u7684\u7528\u6237\u540d\u662f\u60a8\u7684\u963f\u91cc\u4e91\u8d26\u53f7\u5168\u540d\uff0c\u5bc6\u7801\u662f\u60a8\u5f00\u901a\u670d\u52a1\u65f6\u8bbe\u7f6e\u7684\u5bc6\u7801\u3002<\/p>\n<p>#\u4eceregistry\u4e2d\u62c9\u53d6\u955c\u50cf\uff1a<br \/>   $docker pull registry.cn-hangzhou.aliyuncs.com\/cki\/supermap9d:v1<\/p>\n<p>#\u521b\u5efa\u5bb9\u5668\u5e76\u542f\u52a8\u670d\u52a1<br \/>   $docker run -p 60013:8090 -d &#8211;name supmap9d registry.cn-hangzhou.aliyuncs.com\/cki\/supermap9d:v1 \/run.sh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#\u67e5\u770b\u5bb9\u5668ID(containedId) $docker ps -a #\u5220\u9664\u5bb9\u5668 $docker rm con &hellip; <a href=\"http:\/\/blog.langmanezhuang.com\/index.php\/2018\/05\/22\/docker%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4-%e5%ae%b9%e5%99%a8%e7%ae%a1%e7%90%86-%e9%95%9c%e5%83%8f%e7%ae%a1%e7%90%86\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">Docker\u5e38\u7528\u547d\u4ee4 \u5bb9\u5668\u7ba1\u7406  \u955c\u50cf\u7ba1\u7406<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/posts\/924"}],"collection":[{"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/comments?post=924"}],"version-history":[{"count":0,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/posts\/924\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/media?parent=924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/categories?post=924"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.langmanezhuang.com\/index.php\/wp-json\/wp\/v2\/tags?post=924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}