{"id":12099,"date":"2023-08-23T19:31:25","date_gmt":"2023-08-23T11:31:25","guid":{"rendered":"http:\/\/92it.top\/?p=12099"},"modified":"2023-08-23T21:22:52","modified_gmt":"2023-08-23T13:22:52","slug":"%e4%b8%ba%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84%e5%ae%b9%e5%99%a8%e6%b7%bb%e5%8a%a0%e7%ab%af%e5%8f%a3%e6%98%a0%e5%b0%84","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=12099","title":{"rendered":"\u4e3a\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\u6dfb\u52a0\u7aef\u53e3\u6620\u5c04"},"content":{"rendered":"\n<p><strong>\u5f15\u8a00<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u6709\u65f6\u60f3\u5728\u8fd0\u884c\u7684<a rel=\"noreferrer noopener\" href=\"https:\/\/so.csdn.net\/so\/search?q=%E5%AE%B9%E5%99%A8&amp;spm=1001.2101.3001.7020\" target=\"_blank\">\u5bb9\u5668<\/a>\u4e2d\u518d\u6dfb\u52a0\u4e00\u4e2a\u7aef\u53e3\uff0c\u7279\u522b\u662f\u4f7f\u7528\u00a0<code>nginx docker<\/code>\u00a0\u65f6\uff0c\u521a\u5f00\u59cb\u6ca1\u6709\u9884\u7559\u8db3\u591f\u7684\u7aef\u53e3\u6620\u5c04\uff0c\u540e\u6765\u53c8\u8981\u6dfb\u52a0\u51e0\u4e2a\u9879\u76ee\uff0c\u8fd8\u4e0d\u60f3\u542f\u52a8\u591a\u4e2anginx\u7684\u5bb9\u5668\uff0c\u90a3\u4e48\u5c31\u4e00\u5fc3\u60f3\u6dfb\u52a0\u51e0\u4e2a\u7aef\u53e3\u6620\u5c04\u3002<\/p>\n\n\n\n<p>\u6bd4\u5982\u6211\u60f3\u6dfb\u52a0&nbsp;<strong>\u5bbf\u4e3b\u673a\u7684 [18080]<\/strong>&nbsp;\u5230&nbsp;<strong>docker \u7684 [8080]<\/strong>&nbsp;\u7aef\u53e3\u3002<\/p>\n\n\n\n<p><strong>\u65b9\u6cd5\u4e00\uff1a\u5220\u9664\u539f\u6765\u5bb9\u5668\uff0c\u91cd\u65b0run\u4e00\u4e2a\u5bb9\u5668\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u8bb0\u5f97\u91cd\u65b0run\u5bb9\u5668\u7684\u65f6\u5019\u5c06\u9700\u8981\u6620\u5c04\u7684\u7aef\u53e3\u52a0\u4e0a\uff1b\u8fd9\u79cd\u65b9\u6cd5\u53ea\u9002\u5408\u6ca1\u6709\u72b6\u6001\u7684\u5bb9\u5668\u6216\u8005\u6ca1\u6709\u6301\u4e45\u5316\u7684\u5bb9\u5668\uff0c\u6bd5\u7adf\u91cd\u5efa\u540e\u7684\u5bb9\u5668\u662f\u4e00\u4e2a\u5168\u65b0\u7684\uff0c\u4e4b\u524d\u914d\u7f6e\u7684\u4e1c\u897f\u5168\u8fd8\u539f\u4e86\u3002\u4e5f\u53ef\u4ee5\u5c06\u4e4b\u524d\u5bb9\u5668\u4e2d\u7684\u6570\u636e\u901a\u8fc7docker cp\u547d\u4ee4\u62f7\u8d1d\u51fa\u6765\uff0c\u518d\u62f7\u8d1d\u8fdb\u65b0\u7684\u5bb9\u5668\u4e2d\u3002<\/p>\n\n\n\n<p>\u4f18\u7f3a\u70b9\uff1a\u4f18\u70b9\u662f\u7b80\u5355\u5feb\u6377\uff0c\u5728\u6d4b\u8bd5\u73af\u5883\u4f7f\u7528\u8f83\u591a\u3002\u7f3a\u70b9\u662f\u5982\u679c\u662f\u6570\u636e\u5e93\u955c\u50cf\uff0c\u90a3\u91cd\u65b0\u5efa\u4e00\u4e2a\u53c8\u8981\u91cd\u65b0\u914d\u7f6e\u4e00\u6b21\uff0c\u5c31\u6bd4\u8f83\u9ebb\u70e6\u4e86\u3002<\/p>\n\n\n\n<p><strong>\u65b9\u6cd5\u4e8c\uff1a\u4fee\u6539\u5bb9\u5668\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u9700\u8981\u91cd\u542fdocker\u8fdb\u7a0b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u8981\u4fee\u6539\u00a0<code>\/var\/lib\/docker\/containers\/[containerId]<\/code>\u00a0\u76ee\u5f55\u4e0b\uff0c<code>hostconfig.json<\/code>\u00a0\u548c\u00a0<code>config.v2.json<\/code>\u00a0\u4e24\u4e2a\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n\n\n\n<p><strong>1.\u505c\u6b62docker \u670d\u52a1<\/strong><\/p>\n\n\n\n<p>\u4e00\u5b9a\u8981\u5148\u505c docker \u670d\u52a1\uff0c\u8981\u4e0d\u4fee\u6539\u65e0\u6548\uff0c\u8fd8\u4f1a\u88ab\u5237\u56de\u53bb\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl stop docker<\/pre>\n\n\n\n<p>\u6267\u884c <code>systemctl stop docker<\/code> \u540e\u63d0\u793a\u201cWarning: Stopping <a rel=\"noreferrer noopener\" href=\"https:\/\/so.csdn.net\/so\/search?q=docker&amp;spm=1001.2101.3001.7020\" target=\"_blank\">docker<\/a>.service, but it can still be activated by: docker.socket\u201d<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-255-1024x106.png\" alt=\"\" class=\"wp-image-12107\" width=\"532\" height=\"54\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-255-1024x106.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-255-300x31.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-255-768x79.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-255-830x86.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-255-230x24.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-255-350x36.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-255-480x50.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-255.png 1066w\" sizes=\"(max-width: 532px) 100vw, 532px\" \/><\/figure><\/div>\n\n\n\n<p>\u8fd9\u662fdocker\u5728\u5173\u95ed\u72b6\u6001\u4e0b\u88ab\u8bbf\u95ee\u81ea\u52a8\u5524\u9192\u673a\u5236\uff0c\u5f88\u4eba\u6027\u5316\uff0c\u5373\u8fd9\u65f6\u518d\u6267\u884c\u4efb\u610fdocker\u547d\u4ee4\u4f1a\u76f4\u63a5\u542f\u52a8<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-256-1024x833.png\" alt=\"\" class=\"wp-image-12108\" width=\"526\" height=\"428\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-256-1024x833.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-256-300x244.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-256-768x625.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-256-830x675.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-256-230x187.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-256-350x285.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-256-480x391.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-256.png 1288w\" sizes=\"(max-width: 526px) 100vw, 526px\" \/><\/figure><\/div>\n\n\n\n<p>\u6ce8\uff1a\u5982\u679c\u771f\u7684\u4e0d\u5e0c\u671bdocker\u88ab\u8bbf\u95ee\u81ea\u52a8\u5524\u9192\uff0c\u6267\u884c <code>systemctl stop docker<\/code> \u540e\u518d\u6267\u884c<code>systemctl stop docker.socket<\/code>\u5373\u53ef<\/p>\n\n\n\n<p>\u505c\u6b62 docker \u670d\u52a1\uff0c\u6240\u6709\u7684 docker \u5bb9\u5668\u4e5f\u81ea\u52a8\u505c\u4e86\u3002<\/p>\n\n\n\n<p><strong>2. \u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>\u5bb9\u5668\u7684\u914d\u7f6e\u6587\u4ef6\uff1a\/var\/lib\/docker\/containers\/[hash_of_the_container]\/hostconfig.json<\/p>\n\n\n\n<p>\u5bb9\u5668\u7684\u914d\u7f6e\u6587\u4ef6\uff1a\/var\/lib\/docker\/containers\/[hash_of_the_container]\/config.v2.json<\/p>\n\n\n\n<p>\u5176\u4e2d\u7684hash of the container\u662fdocker\u955c\u50cf\u7684hash\u503c\uff0c\u53ef\u4ee5\u901a\u8fc7docker ps\u6216\u8005docker inspect containername\u67e5\u770b\u3002\uff08CONTAINER ID\u5c31\u53ef\u4ee5\u770b\u51fa\u6765\uff09<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-253-1024x317.png\" alt=\"\" class=\"wp-image-12100\" width=\"533\" height=\"165\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-253-1024x317.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-253-300x93.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-253-768x237.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-253-830x257.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-253-230x71.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-253-350x108.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-253-480x148.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-253.png 1520w\" sizes=\"(max-width: 533px) 100vw, 533px\" \/><\/figure><\/div>\n\n\n\n<p>\u6839\u636e\u4f60\u7684\u5b9e\u9645\u5bb9\u5668id\u53bb\u67e5\u627e<\/p>\n\n\n\n<p><strong>2.1 \u4fee\u6539 hostconfig.json\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p><code>hostconfig.json<\/code>\u00a0\u6587\u4ef6\u7528\u4e8e\u63cf\u8ff0\u5bb9\u5668\u4e0e\u5bbf\u4e3b\u673a\u4e4b\u95f4\u7684\u4ea4\u4e92\u4fe1\u606f\uff0c\u5305\u62ec\u7aef\u53e3\u6620\u5c04\u3001\u6302\u8f7d\u5377\u7b49\u3002\u5176\u4e2d\u7684\u00a0<code>PortBindings<\/code>\u00a0\u5b57\u6bb5\u6307\u5b9a\u5bb9\u5668\u5185\u90e8\u7aef\u53e3\u4e0e\u5bbf\u4e3b\u673a\u7aef\u53e3\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u7528\u4e8e\u5b9e\u73b0\u5bb9\u5668\u5185\u90e8\u670d\u52a1\u7684\u5916\u90e8\u8bbf\u95ee\u3002<\/p>\n\n\n\n<p>\u53ea\u9700\u7ed9\u00a0<strong>PortBindings<\/strong>\u00a0\u9009\u9879\u6dfb\u52a0\u4e00\u9879\u00a0<strong>&#8220;8080\/tcp&#8221;:[{&#8220;HostIp&#8221;:&#8221;&#8221;,&#8221;HostPort&#8221;:&#8221;18080&#8243;}]<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n    # ... \u7701\u7565\u5176\u4ed6\u4e0d\u76f8\u5173\n    \n    \"PortBindings\":{\n        \"22\/tcp\":[{\"HostIp\":\"\",\"HostPort\":\"5022\"}],\n        \n        # \u6dfb\u52a0\u65b0\u7684\u6620\u5c04\u4ee3\u7801\n        \"8080\/tcp\":[{\"HostIp\":\"\",\"HostPort\":\"18080\"}]\n    },\n    \n    # ... \u7701\u7565\u5176\u4ed6\u4e0d\u76f8\u5173\n}\n<\/pre>\n\n\n\n<p><strong>2.2 \u4fee\u6539config.v2.json \u6587\u4ef6<\/strong><\/p>\n\n\n\n<p><code>config.v2.json<\/code>\u00a0\u6587\u4ef6\u7528\u4e8e\u63cf\u8ff0\u5bb9\u5668\u7684\u914d\u7f6e\u4fe1\u606f\uff0c\u5305\u62ec\u5bb9\u5668\u7684\u547d\u4ee4\u3001\u73af\u5883\u53d8\u91cf\u3001\u66b4\u9732\u7684\u7aef\u53e3\u7b49\u3002\u5176\u4e2d\u7684\u00a0<code>Ports<\/code>\u00a0\u5b57\u6bb5\u6307\u5b9a\u5bb9\u5668\u5185\u90e8\u6b63\u5728\u76d1\u542c\u7684\u7aef\u53e3\uff0c\u4f46\u5e76\u4e0d\u8868\u793a\u8fd9\u4e9b\u7aef\u53e3\u4f1a\u6620\u5c04\u5230\u5bbf\u4e3b\u673a\u4e0a\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">    # ... \u7701\u7565\u5176\u4ed6\u4e0d\u76f8\u5173\n    \n    # \u5bf9\u5916\u66b4\u9732\u7aef\u53e3\n    \"ExposedPorts\":{\n        \"22\/tcp\":{},\n        \n        # \u6dfb\u52a0\u65b0\u7684\u6620\u5c04\u4ee3\u7801\n        \"8080\/tcp\":{}\n    }\n    \n    # ... \u7701\u7565\u5176\u4ed6\u4e0d\u76f8\u5173\n    \n    # \u5982\u679cPorts\u5b57\u6bb5\u672c\u6765\u5c31\u662f\u7a7a\uff0c\u90a3\u5c31\u4e0d\u7528\u4fee\u6539\n    \"Ports\": {\n        \"22\/tcp\": [{\"HostIp\": \"0.0.0.0\",\"HostPort\": \"5022\"}],\n        \n         # \u6dfb\u52a0\u65b0\u7684\u6620\u5c04\u4ee3\u7801\n        \"8080\/tcp\": [{\"HostIp\": \"0.0.0.0\",\"HostPort\": \"18080\"}],\n    }\n    \n    # ... \u7701\u7565\u5176\u4ed6\u4e0d\u76f8\u5173<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">docker \u914d\u7f6e\u6587\u4ef6 config.v2.json \u4e2d Ports \u548c hostconfig.json \u4e2d PortBindings \u533a\u522b:\n\nconfig.v2.json \u4e3b\u8981\u7528\u4e8e\u63cf\u8ff0\u5bb9\u5668\u7684\u914d\u7f6e\u4fe1\u606f\uff0cPorts \u5b57\u6bb5\u7528\u4e8e\u6307\u5b9a\u5bb9\u5668\u5185\u90e8\u6b63\u5728\u76d1\u542c\u7684\u7aef\u53e3\uff0c\u5373\u5bb9\u5668\u5185\u7684\u7aef\u53e3\u3002\u56e0\u4e3a ExposedPorts \u5b57\u6bb5\u5df2\u7ecf\u5bf9\u5916\u66b4\u9732\u4e86\u7aef\u53e3\uff0c\u6240\u4ee5\u5982\u679c\u5bbf\u4e3b\u673a\u6240\u6709ip\u90fd\u53ef\u4ee5\u6620\u5c04\u5230\u66b4\u9732\u7684\u7aef\u53e3\uff0c\u90a3\u4e48\u6b64\u5904 Ports \u5b57\u6bb5\u5c31\u53ef\u4ee5\u4e3a\u7a7a\u3002\u5982\u679c\u9700\u8981\u8bbe\u7f6e\u5bf9\u5e94\u7684IP\u90a3\u4e48\u5c31\u5e94\u8be5\u8bbe\u7f6e\u3002\n\nhostconfig.json \u4e3b\u8981\u7528\u4e8e\u63cf\u8ff0\u5bb9\u5668\u4e0e\u5bbf\u4e3b\u673a\u4e4b\u95f4\u7684\u4ea4\u4e92\u4fe1\u606f\uff0c PortBindings \u5b57\u6bb5\u7528\u4e8e\u6307\u5b9a\u5bb9\u5668\u5185\u90e8\u7aef\u53e3\u4e0e\u5bbf\u4e3b\u673a\u7aef\u53e3\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u7528\u4e8e\u5b9e\u73b0\u5bb9\u5668\u5185\u90e8\u670d\u52a1\u7684\u5916\u90e8\u8bbf\u95ee\u3002\n\n\u7531\u4e8e Ports \u548c PortBindings \u90fd\u6d89\u53ca\u5bb9\u5668\u7684\u7aef\u53e3\u6620\u5c04\uff0c\u6709\u65f6\u5019\u53ef\u80fd\u4f1a\u9020\u6210\u4e00\u4e9b\u5197\u4f59\u548c\u6df7\u6dc6\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u5728 Docker \u4e2d\uff0c\u63a8\u8350\u4f7f\u7528 PortBindings \u6765\u6307\u5b9a\u5bb9\u5668\u7684\u7aef\u53e3\u6620\u5c04\uff0c\u800c\u5c06 config.v2.json \u4e2d\u7684 Ports \u5b57\u6bb5\u7559\u7a7a\u6216\u4e0d\u6307\u5b9a\u3002\u8fd9\u6837\u53ef\u4ee5\u66f4\u6e05\u6670\u5730\u8868\u8fbe\u5bb9\u5668\u4e0e\u5bbf\u4e3b\u673a\u4e4b\u95f4\u7684\u7aef\u53e3\u6620\u5c04\u5173\u7cfb\uff0c\u51cf\u5c11\u91cd\u590d\u914d\u7f6e\u3002\r<\/pre>\n\n\n\n<p>\u4f18\u7f3a\u70b9\uff1a\u8fd9\u4e2a\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u6ca1\u6709\u526f\u4f5c\u7528\uff0c\u64cd\u4f5c\u7b80\u5355\u3002\u7f3a\u70b9\u662f\u9700\u8981\u91cd\u542f\u6574\u4e2adocker\u670d\u52a1\uff0c\u5982\u679c\u5728\u540c\u4e00\u4e2a\u5bbf\u4e3b\u673a\u4e0a\u8fd0\u884c\u7740\u591a\u4e2a\u5bb9\u5668\u670d\u52a1\u7684\u8bdd\uff0c\u5c31\u4f1a\u5f71\u54cd\u5176\u4ed6\u5bb9\u5668\u670d\u52a1\u3002<\/p>\n\n\n\n<p><strong>3.\u91cd\u542f docker\u670d\u52a1<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl restart docker<\/pre>\n\n\n\n<p><strong>\u65b9\u6cd5\u4e09\uff1a\u4f7f\u7528docker commit\u5c06\u5f53\u524d\u5bb9\u5668\u521b\u5efa\u4e3a\u4e00\u4e2a\u955c\u50cf\uff0c\u5728\u542f\u52a8\u8fd9\u4e2a\u955c\u50cf\u65f6\u6620\u5c04\u65b0\u7684\u7aef\u53e3\u53f7\u51fa\u6765\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>docker commit\uff1a\u628a\u4e00\u4e2a\u5bb9\u5668\u7684\u6587\u4ef6\u6539\u52a8\u548c\u914d\u7f6e\u4fe1\u606fcommit\u5230\u4e00\u4e2a\u65b0\u7684\u955c\u50cf\u3002\u8fd9\u4e2a\u5728\u6d4b\u8bd5\u7684\u65f6\u5019\u4f1a\u975e\u5e38\u6709\u7528\uff0c\u628a\u5bb9\u5668\u6240\u6709\u7684\u6587\u4ef6\u6539\u52a8\u548c\u914d\u7f6e\u4fe1\u606f\u5bfc\u5165\u6210\u4e00\u4e2a\u65b0\u7684docker\u955c\u50cf\uff0c\u7136\u540e\u7528\u8fd9\u4e2a\u65b0\u7684\u955c\u50cf\u91cd\u8d77\u4e00\u4e2a\u5bb9\u5668\uff0c\u8fd9\u5bf9\u4e4b\u524d\u7684\u5bb9\u5668\u4e0d\u4f1a\u6709\u4efb\u4f55\u5f71\u54cd\u3002<\/p>\n\n\n\n<p>1\u3001\u505c\u6b62docker\u5bb9\u5668<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker stop container01 <\/pre>\n\n\n\n<p>2\u3001commit\u8be5docker\u5bb9\u5668<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker commit container01 new_image:tag <\/pre>\n\n\n\n<p>3\u3001\u7528\u524d\u4e00\u6b65\u65b0\u751f\u6210\u7684\u955c\u50cf\u91cd\u65b0\u8d77\u4e00\u4e2a\u5bb9\u5668<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker run --name container02 -p 80:80 new_image:tag <\/pre>\n\n\n\n<p>\u4f18\u7f3a\u70b9\uff1a\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u4e0d\u4f1a\u5f71\u54cd\u7edf\u4e00\u5bbf\u4e3b\u673a\u4e0a\u7684\u5176\u4ed6\u5bb9\u5668\uff0c\u7f3a\u70b9\u662f\u7ba1\u7406\u8d77\u6765\u663e\u5f97\u6bd4\u8f83\u4e71\uff0c\u6ca1\u6709\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u90a3\u4e48\u76f4\u89c2\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f15\u8a00 \u6709\u65f6\u60f3\u5728\u8fd0\u884c\u7684\u5bb9\u5668\u4e2d\u518d\u6dfb\u52a0\u4e00\u4e2a\u7aef\u53e3\uff0c\u7279\u522b\u662f\u4f7f\u7528\u00a0nginx docker\u00a0\u65f6\uff0c\u521a\u5f00\u59cb\u6ca1\u6709\u9884\u7559\u8db3\u591f\u7684\u7aef\u53e3\u6620 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/12099"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12099"}],"version-history":[{"count":9,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/12099\/revisions"}],"predecessor-version":[{"id":12112,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/12099\/revisions\/12112"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}