{"id":471,"date":"2025-07-28T01:20:02","date_gmt":"2025-07-27T17:20:02","guid":{"rendered":"https:\/\/shop.etsow.com\/news\/?p=471"},"modified":"2025-07-28T01:20:02","modified_gmt":"2025-07-27T17:20:02","slug":"%e9%ad%94%e4%ba%91%e8%85%be%e9%95%9c%e5%83%8f%ef%bc%9a%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e6%9e%84%e5%bb%ba%e5%b9%b6%e4%bc%98%e5%8c%96%e9%95%9c%e5%83%8f%ef%bc%9f%e7%9c%81%e6%97%b6%e9%ab%98%e6%95%88","status":"publish","type":"post","link":"https:\/\/shop.etsow.com\/news\/?p=471","title":{"rendered":"\u9b54\u4e91\u817e\u955c\u50cf\uff1a\u5982\u4f55\u5feb\u901f\u6784\u5efa\u5e76\u4f18\u5316\u955c\u50cf\uff1f\u7701\u65f6\u9ad8\u6548\u7684\u89e3\u51b3\u65b9\u6848\uff01"},"content":{"rendered":"<p>\u200b<strong>\u200b\u9b54\u4e91\u817e\u955c\u50cf\uff1a\u5982\u4f55\u5feb\u901f\u6784\u5efa\u5e76\u4f18\u5316\u955c\u50cf\uff1f\u7701\u65f6\u9ad8\u6548\u7684\u89e3\u51b3\u65b9\u6848\uff01\u200b<\/strong>\u200b<\/p>\n<p>\u5728\u5bb9\u5668\u5316\u6280\u672f\u5feb\u901f\u53d1\u5c55\u7684\u4eca\u5929\uff0c\u200b<strong>\u200b\u9ad8\u6548\u6784\u5efa\u548c\u4f18\u5316Docker\u955c\u50cf\u200b<\/strong>\u200b\u5df2\u6210\u4e3a\u5f00\u53d1\u8005\u548c\u8fd0\u7ef4\u56e2\u961f\u7684\u6838\u5fc3\u9700\u6c42\u3002\u5c24\u5176\u5bf9\u4e8e\u9b54\u4e91\u817e\u8fd9\u7c7b\u57fa\u4e8eDocker\u7684\u4e91\u624b\u673a\u5e73\u53f0\uff0c\u955c\u50cf\u7684\u8f7b\u91cf\u5316\u4e0e\u6784\u5efa\u901f\u5ea6\u76f4\u63a5\u5f71\u54cd\u591a\u5f00\u6027\u80fd\u4e0e\u8d44\u6e90\u5229\u7528\u7387\u3002\u672c\u6587\u5c06\u6df1\u5165\u89e3\u6790\u200b<strong>\u200b\u4ece\u57fa\u7840\u6784\u5efa\u5230\u9ad8\u9636\u4f18\u5316\u7684\u5168\u6d41\u7a0b\u65b9\u6848\u200b<\/strong>\u200b\uff0c\u5e2e\u52a9\u60a8\u5b9e\u73b0\u5feb\u901f\u90e8\u7f72\u4e0e\u8d44\u6e90\u8282\u7701\u3002<\/p>\n<hr \/>\n<h3>\u200b<strong>\u200b\u75db\u70b9\uff1a\u4e3a\u4ec0\u4e48\u9b54\u4e91\u817e\u955c\u50cf\u9700\u8981\u4f18\u5316\uff1f\u200b<\/strong>\u200b<\/h3>\n<p>\u9b54\u4e91\u817e\u901a\u8fc7Docker\u5bb9\u5668\u8fd0\u884c\u591a\u4e2a\u5b89\u5353\u5b9e\u4f8b\uff0c\u82e5\u955c\u50cf\u4f53\u79ef\u8fc7\u5927\u6216\u6784\u5efa\u6548\u7387\u4f4e\u4e0b\uff0c\u4f1a\u5bfc\u81f4\uff1a<\/p>\n<ul>\n<li>\n<p>\u200b<strong>\u200b\u8d44\u6e90\u6d6a\u8d39\u200b<\/strong>\u200b\uff1a\u5197\u4f59\u6587\u4ef6\u5360\u7528\u5b58\u50a8\uff0c\u964d\u4f4e\u4e3b\u673a\u5e76\u53d1\u80fd\u529b\uff1b<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u542f\u52a8\u5ef6\u8fdf\u200b<\/strong>\u200b\uff1a\u955c\u50cf\u4f20\u8f93\u548c\u52a0\u8f7d\u65f6\u95f4\u5ef6\u957f\uff0c\u5f71\u54cd\u7528\u6237\u4f53\u9a8c\uff1b<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u6210\u672c\u589e\u52a0\u200b<\/strong>\u200b\uff1a\u4e91\u4e3b\u673a\u5b9e\u4f8b\u7684\u8ba1\u8d39\u4e0e\u8d44\u6e90\u6d88\u8017\u76f4\u63a5\u6302\u94a9\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>\u200b<strong>\u200b\u4e00\u3001\u9009\u62e9\u9ad8\u6548\u57fa\u7840\u955c\u50cf\uff1a\u8f7b\u91cf\u5316\u662f\u6838\u5fc3\u200b<\/strong>\u200b<\/h3>\n<p>\u200b<strong>\u200b\u95ee\u9898\u200b<\/strong>\u200b\uff1a\u5982\u4f55\u5e73\u8861\u529f\u80fd\u5b8c\u6574\u6027\u4e0e\u955c\u50cf\u4f53\u79ef\uff1f<\/p>\n<p>\u200b<strong>\u200b\u7b54\u6848\u200b<\/strong>\u200b\uff1a\u4f18\u5148\u9009\u62e9\u4e13\u4e3a\u5bb9\u5668\u8bbe\u8ba1\u7684\u8f7b\u91cf\u7ea7\u57fa\u7840\u955c\u50cf\uff0c\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li>\n<p>\u200b<strong>\u200bAlpine Linux\u200b<\/strong>\u200b\uff1a\u4ec55MB\u5927\u5c0f\uff0c\u9002\u5408\u8fd0\u884c\u73af\u5883\uff1b<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200bDistroless\u200b<\/strong>\u200b\uff1a\u8c37\u6b4c\u63a8\u51fa\u7684\u65e0Shell\u955c\u50cf\uff0c\u5b89\u5168\u6027\u66f4\u9ad8\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u200b<strong>\u200b\u64cd\u4f5c\u5efa\u8bae\u200b<\/strong>\u200b\uff1a<\/p>\n<ol>\n<li>\n<p>\u66ff\u6362\u9ed8\u8ba4\u955c\u50cf\u6807\u7b7e\uff08\u5982<code class=\"hyc-common-markdown__code__inline\">ubuntu:latest<\/code>\u2192<code class=\"hyc-common-markdown__code__inline\">alpine:3.18<\/code>\uff09\uff1b<\/p>\n<\/li>\n<li>\n<p>\u9a8c\u8bc1\u4f9d\u8d56\u517c\u5bb9\u6027\uff0c\u907f\u514d\u8fd0\u884c\u65f6\u7f3a\u5931\u5e93\u6587\u4ef6\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u200b<strong>\u200b\u5bf9\u6bd4\u6570\u636e\u200b<\/strong>\u200b\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\n<p>\u57fa\u7840\u955c\u50cf<\/p>\n<\/th>\n<th>\n<p>\u4f53\u79ef<\/p>\n<\/th>\n<th>\n<p>\u9002\u7528\u573a\u666f<\/p>\n<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n<p>Ubuntu<\/p>\n<\/td>\n<td>\n<p>72MB<\/p>\n<\/td>\n<td>\n<p>\u5168\u529f\u80fd\u5f00\u53d1\u73af\u5883<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Alpine<\/p>\n<\/td>\n<td>\n<p>5MB<\/p>\n<\/td>\n<td>\n<p>\u751f\u4ea7\u73af\u5883\u8fd0\u884c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Scratch<\/p>\n<\/td>\n<td>\n<p>0MB<\/p>\n<\/td>\n<td>\n<p>\u9759\u6001\u4e8c\u8fdb\u5236\u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u200b<strong>\u200b\u4e8c\u3001\u591a\u9636\u6bb5\u6784\u5efa\uff1a\u5206\u79bb\u7f16\u8bd1\u4e0e\u8fd0\u884c\u73af\u5883\u200b<\/strong>\u200b<\/h3>\n<p>\u200b<strong>\u200b\u539f\u7406\u200b<\/strong>\u200b\uff1a\u901a\u8fc7\u591a\u9636\u6bb5\u6784\u5efa\uff0c\u4ec5\u4fdd\u7559\u6700\u7ec8\u4ea7\u7269\uff0c\u5254\u9664\u4e2d\u95f4\u6587\u4ef6\u3002\u4f8b\u5982\u9b54\u4e91\u817e\u7684\u5b89\u5353\u955c\u50cf\u6784\u5efa\uff1a<\/p>\n<p>\u200b<strong>\u200b\u4f18\u52bf\u200b<\/strong>\u200b\uff1a<\/p>\n<ul>\n<li>\n<p>\u200b<strong>\u200b\u4f53\u79ef\u51cf\u5c1190%\u200b<\/strong>\u200b\uff1a\u67d0\u6848\u4f8b\u4e2d\uff0cJava\u5e94\u7528\u955c\u50cf\u4ece350MB\u964d\u81f335MB\uff1b<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u5b89\u5168\u6027\u63d0\u5347\u200b<\/strong>\u200b\uff1a\u8fd0\u884c\u73af\u5883\u65e0\u7f16\u8bd1\u5de5\u5177\uff0c\u964d\u4f4e\u653b\u51fb\u9762\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>\u200b<strong>\u200b\u4e09\u3001\u7f13\u5b58\u4f18\u5316\uff1a\u52a0\u901f\u6784\u5efa\u6d41\u7a0b\u200b<\/strong>\u200b<\/h3>\n<p>\u200b<strong>\u200b\u5173\u952e\u7b56\u7565\u200b<\/strong>\u200b\uff1a<\/p>\n<ol>\n<li>\n<p>\u200b<strong>\u200b\u5206\u5c42\u7f13\u5b58\u200b<\/strong>\u200b\uff1a\u5c06\u53d8\u52a8\u9891\u7387\u4f4e\u7684\u6307\u4ee4\uff08\u5982<code class=\"hyc-common-markdown__code__inline\">COPY package.json<\/code>\uff09\u524d\u7f6e\uff1b<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200bBuildKit\u52a0\u901f\u200b<\/strong>\u200b\uff1a\u542f\u7528\u5e76\u884c\u6784\u5efa\u4e0e\u7f13\u5b58\u6302\u8f7d\uff08\u9700Docker 18.09+\uff09\uff1a<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b.dockerignore\u6587\u4ef6\u200b<\/strong>\u200b\uff1a\u6392\u9664<code class=\"hyc-common-markdown__code__inline\">node_modules\/<\/code>\u3001\u65e5\u5fd7\u7b49\u65e0\u7528\u6587\u4ef6\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u200b<strong>\u200b\u5b9e\u6d4b\u6548\u679c\u200b<\/strong>\u200b\uff1a\u5408\u7406\u5229\u7528\u7f13\u5b58\u53ef\u4f7f\u6784\u5efa\u65f6\u95f4\u7f29\u77ed60%\u4ee5\u4e0a\u3002<\/p>\n<hr \/>\n<h3>\u200b<strong>\u200b\u56db\u3001\u8fd0\u884c\u65f6\u4f18\u5316\uff1a\u8d44\u6e90\u9650\u5236\u4e0e\u5b89\u5168\u52a0\u56fa\u200b<\/strong>\u200b<\/h3>\n<p>\u200b<strong>\u200b\u9488\u5bf9\u9b54\u4e91\u817e\u7684\u7279\u522b\u5efa\u8bae\u200b<\/strong>\u200b\uff1a<\/p>\n<ul>\n<li>\n<p>\u200b<strong>\u200b\u8d44\u6e90\u914d\u989d\u200b<\/strong>\u200b\uff1a\u901a\u8fc7<code class=\"hyc-common-markdown__code__inline\">docker run --memory=2G<\/code>\u9650\u5236\u5355\u4e2a\u5bb9\u5668\u5185\u5b58\uff0c\u907f\u514d\u591a\u5f00\u65f6\u8d44\u6e90\u4e89\u62a2\uff1b<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u975eRoot\u8fd0\u884c\u200b<\/strong>\u200b\uff1a\u5728Dockerfile\u4e2d\u6dfb\u52a0\uff1a<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u5b9a\u671f\u626b\u63cf\u6f0f\u6d1e\u200b<\/strong>\u200b\uff1a\u96c6\u6210Trivy\u5de5\u5177\uff0c\u68c0\u6d4b\u955c\u50cf\u4e2d\u7684CVE\u6f0f\u6d1e\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>\u200b<strong>\u200b\u4e94\u3001\u5b9e\u6218\u6848\u4f8b\uff1a\u9b54\u4e91\u817e\u955c\u50cf\u4f18\u5316\u524d\u540e\u5bf9\u6bd4\u200b<\/strong>\u200b<\/h3>\n<p>\u67d0\u7528\u6237\u4f18\u5316\u540e\u6570\u636e\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\n<p>\u6307\u6807<\/p>\n<\/th>\n<th>\n<p>\u4f18\u5316\u524d<\/p>\n<\/th>\n<th>\n<p>\u4f18\u5316\u540e<\/p>\n<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n<p>\u955c\u50cf\u4f53\u79ef<\/p>\n<\/td>\n<td>\n<p>1.2GB<\/p>\n<\/td>\n<td>\n<p>280MB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u6784\u5efa\u65f6\u95f4<\/p>\n<\/td>\n<td>\n<p>8\u5206\u949f<\/p>\n<\/td>\n<td>\n<p>3\u5206\u949f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u5355\u4e3b\u673a\u5b9e\u4f8b\u6570<\/p>\n<\/td>\n<td>\n<p>8\u4e2a<\/p>\n<\/td>\n<td>\n<p>12\u4e2a<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u200b<strong>\u200b\u72ec\u5bb6\u89c1\u89e3\u200b<\/strong>\u200b\uff1a\u9b54\u4e91\u817e\u7684\u786c\u4ef6\u6027\u80fd\uff08\u5982RK3588\u82af\u7247\uff09\u867d\u5f3a\uff0c\u4f46\u200b<strong>\u200b\u8f6f\u4ef6\u4fa7\u4f18\u5316\u624d\u662f\u91ca\u653e\u6f5c\u529b\u7684\u5173\u952e\u200b<\/strong>\u200b\u3002\u4f8b\u5982\uff0c\u901a\u8fc7\u591a\u9636\u6bb5\u6784\u5efa\u548cAlpine\u57fa\u7840\u955c\u50cf\uff0c\u53ef\u663e\u8457\u63d0\u5347\u591a\u5f00\u5bc6\u5ea6\u3002<\/p>\n<hr \/>\n<p>\u200b<strong>\u200b\u6700\u7ec8\u5efa\u8bae\u200b<\/strong>\u200b\uff1a\u5c06\u4e0a\u8ff0\u6280\u5de7\u7eb3\u5165CI\/CD\u6d41\u7a0b\uff0c\u7ed3\u5408\u9b54\u4e91\u817e\u7684Docker API\u5b9e\u73b0\u81ea\u52a8\u5316\u955c\u50cf\u6784\u5efa\u4e0e\u90e8\u7f72\u30022025\u5e74\u7684\u5bb9\u5668\u6280\u672f\u7ade\u4e89\u4e2d\uff0c\u200b<strong>\u200b\u201c\u5c0f\u800c\u5feb\u201d\u7684\u955c\u50cf\u5df2\u662f\u521a\u9700\u200b<\/strong>\u200b\uff0c\u800c\u975e\u53ef\u9009\u4f18\u5316\u9879\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u200b\u200b\u9b54\u4e91\u817e\u955c\u50cf\uff1a\u5982\u4f55\u5feb\u901f\u6784\u5efa\u5e76\u4f18\u5316\u955c\u50cf\uff1f\u7701\u65f6\u9ad8\u6548\u7684\u89e3\u51b3\u65b9\u6848\uff01&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1562,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-471","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-5"],"_links":{"self":[{"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/posts\/471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=471"}],"version-history":[{"count":1,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/posts\/471\/revisions"}],"predecessor-version":[{"id":1563,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/posts\/471\/revisions\/1563"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/media\/1562"}],"wp:attachment":[{"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}