\u4eca\u5929\u5728\u6280\u672f\u7fa4\u6478\u9c7c\uff0c\u6709\u670b\u53cb\u95ee\u4e2adocker\u7684\u95ee\u9898\uff0c\u66ff\u6362\u914d\u7f6e\u6587\u4ef6\u4e0d\u751f\u6548\uff0c\u4e5f\u6ca1\u6709\u539f\u5148\u7684Dockerfile\uff0c\u6240\u4ee5\u5c31\u5728\u60f3\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u65b9\u5f0f\u53ef\u4ee5\u76f4\u63a5\u4ece\u5bb9\u5668\u6216\u955c\u50cf\u751f\u6210Dockerfile\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\u867d\u7136docker history\u547d\u4ee4\u53ef\u4ee5\u770b\u5230\u6240\u6709\u5386\u53f2\u5c42\u7ea7\u7684\u64cd\u4f5c\uff0c\u4f46\u662f\u8fd8\u662f\u9700\u8981\u624b\u52a8\u53bb\u5199Dockerfile<\/p>\n
google\u4e00\u756a\uff0c\u53d1\u73b0dfimage\u5c31\u662f\u8fd9\u6837\u4e00\u4e2a\u5de5\u5177<\/p>\n
dfimage\u662f\u4e00\u4e2aalpine\u7684\u955c\u50cf\uff0c\u542f\u52a8\u7684\u65f6\u5019\uff0c\u901a\u8fc7\u5c06docker.sock\u6620\u5c04\u5230\u5bb9\u5668\u5185\u90e8\u6765\u8fd0\u884c\uff0c\u901a\u5e38\u5c06\u8fd9\u4e2a\u64cd\u4f5c\u505a\u6210\u522b\u540d<\/p>\n
alias dfimage=\"docker run -v \/var\/run\/docker.sock:\/var\/run \r\n\/docker.sock --rm alpine\/dfimage\" \r\n \r\ndfimage -sV=1.36 nginx:latest <\/pre>\n\u6211\u4eec\u62ffnginx\u955c\u50cf\u8bd5\u9a8c\u4e0b<\/p>\n
<\/p>\n
\u5148pull\u4e00\u4e2anginx\u955c\u50cf\uff0c\u6211\u8fd9\u91cc\u4e4b\u524d\u6709\uff0c\u5c31\u76f4\u63a5\u7528\u4e86\uff0c\u63a5\u7740\u901a\u8fc7\u4e0a\u9762\u63d0\u5230\u7684\u547d\u4ee4\uff0c\u522b\u540d\u4e00\u4e2adfimage\u547d\u4ee4<\/p>\n
<\/p>\n
\u505a\u597d\u522b\u540d\u4e4b\u540e\uff0c\u901a\u8fc7dfimage\u53bb\u751f\u6210nginx\u7684Dockerfile\uff0c\u5176\u5b9e\u5c31\u662f\u542f\u52a8\u4e00\u4e2a\u5bb9\u5668\u5de5\u5177\uff0c\u6267\u884c\u5b8c\u4e4b\u540e\u5373\u5220\u9664<\/p>\n
<\/p>\n
<\/p>\n
\u5373\u53ef\u770b\u5230\u5b8c\u6574\u7684Dockerfile<\/p>\n
\u53c2\u8003\uff1ahttps:\/\/hub.docker.com\/repository\/docker\/alpine\/dfimage<\/p>\n","protected":false},"excerpt":{"rendered":"
\u867d\u7136docker history\u547d\u4ee4\u53ef\u4ee5\u770b\u5230\u6240\u6709\u5386\u53f2\u5c42\u7ea7\u7684\u64cd\u4f5c\uff0c\u4f46\u662f\u8fd8\u662f\u9700\u8981\u624b\u52a8\u53bb\u5199Dockerfile go […]<\/p>\n","protected":false},"author":1920,"featured_media":218479,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-219046","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/219046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1920"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=219046"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/219046\/revisions"}],"predecessor-version":[{"id":219194,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/219046\/revisions\/219194"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/218479"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=219046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=219046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=219046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}