{"id":34935,"date":"2023-01-20T23:52:11","date_gmt":"2023-08-11T03:13:17","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/"},"modified":"2024-01-15T08:26:55","modified_gmt":"2024-01-15T00:26:55","slug":"docker%e5%a4%87%e5%bf%98%e5%bd%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/","title":{"rendered":"Docker\u5907\u5fd8\u5f55"},"content":{"rendered":"<h1>\u5220\u9664Container<\/h1>\n<pre class=\"post-pre\"><code><span class=\"go\">docker rm test -fv\r\n\r\ndocker build -t test . \r\n\r\ndocker run \r\n    -d \r\n<\/span><span class=\"gp\">    -v $<\/span><span class=\"o\">{<\/span><span class=\"nb\">pwd<\/span><span class=\"o\">}<\/span>:\/usr\/src\/app \r\n<span class=\"go\">    -v data:\/usr\/src\/app\/node_modules \r\n    --name test \r\n    -p 3000:4000 \r\n    --env-file .\/.env \r\n    test\r\n<\/span><\/code><\/pre>\n<h1>Dockerfile:<br \/>\nDocker\u6587\u4ef6<\/h1>\n<pre class=\"post-pre\"><code>    FROM node:alpine3.18\r\n    \r\n    WORKDIR \/usr\/src\/app\r\n    \r\n    COPY package.json .\r\n    \r\n    RUN npm install\r\n    \r\n    COPY . .\/\r\n    \r\n    ENV PORT=3000\r\n    \r\n    EXPOSE ${PORT}\r\n    \r\n    CMD [ \"npm\", \"run\", \"dev\" ]\r\n\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5220\u9664Container docker rm test -fv docker build -t test . d [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-34935","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Docker\u5907\u5fd8\u5f55 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/docker\u5907\u5fd8\u5f55\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker\u5907\u5fd8\u5f55\" \/>\n<meta property=\"og:description\" content=\"\u5220\u9664Container docker rm test -fv docker build -t test . d [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/docker\u5907\u5fd8\u5f55\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-11T03:13:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-15T00:26:55+00:00\" \/>\n<meta name=\"author\" content=\"\u65b0, \u97f5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u65b0, \u97f5\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/\",\"name\":\"Docker\u5907\u5fd8\u5f55 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-08-11T03:13:17+00:00\",\"dateModified\":\"2024-01-15T00:26:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docker\u5907\u5fd8\u5f55\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\",\"name\":\"\u65b0, \u97f5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"caption\":\"\u65b0, \u97f5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Docker\u5907\u5fd8\u5f55 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/docker\u5907\u5fd8\u5f55\/","og_locale":"zh_CN","og_type":"article","og_title":"Docker\u5907\u5fd8\u5f55","og_description":"\u5220\u9664Container docker rm test -fv docker build -t test . d [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/docker\u5907\u5fd8\u5f55\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-08-11T03:13:17+00:00","article_modified_time":"2024-01-15T00:26:55+00:00","author":"\u65b0, \u97f5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u65b0, \u97f5"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/","name":"Docker\u5907\u5fd8\u5f55 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-08-11T03:13:17+00:00","dateModified":"2024-01-15T00:26:55+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Docker\u5907\u5fd8\u5f55"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9","name":"\u65b0, \u97f5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","caption":"\u65b0, \u97f5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/docker%e5%a4%87%e5%bf%98%e5%bd%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=34935"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34935\/revisions"}],"predecessor-version":[{"id":57769,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34935\/revisions\/57769"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=34935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=34935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=34935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}