{"id":468,"date":"2021-09-17T03:14:00","date_gmt":"2021-09-17T03:14:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=468"},"modified":"2023-08-13T14:49:22","modified_gmt":"2023-08-13T06:49:22","slug":"468","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/09\/17\/468\/","title":{"rendered":"\u6784\u5efa\u591a\u5e73\u53f0 Docker \u955c\u50cf\u4e4b\u4e8c   \u66f4\u6362 multiarch\/qemu-user-static"},"content":{"rendered":"<p>debian 11 \u540e\uff0c\u4e4b\u524d\u7684 <code>Dockerfile<\/code> \u5236\u4f5c\u591a\u5e73\u53f0\u955c\u50cf, \u63d0\u793a qemu \u8fd0\u884c\u9519\u8bef,\u6362\u4e2a <code>multiarch\/qemu-user-static<\/code> \u78b0\u78b0\u8fd0\u6c14\u3002<\/p>\n<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/09\/4235832562.jpg\" alt=\"logo.jpg\" title=\"logo.jpg\"><\/p>\n<h3><a href=\"https:\/\/github.com\/multiarch\/qemu-user-static\">https:\/\/github.com\/multiarch\/qemu-user-static<\/a><\/h3>\n<pre><code>docker run --rm --privileged multiarch\/qemu-user-static --reset -p yes\ndocker buildx rm builder\ndocker buildx create --name builder --driver docker-container --use\ndocker buildx inspect --bootstrap<\/code><\/pre>\n<h3>\u6784\u5efa\u591a\u5e73\u53f0 Docker \u955c\u50cf<\/h3>\n<p>\u5229\u7528 Docker \u5f15\u5165\u7684\u63d2\u4ef6 buildx\uff0c\u53ef\u4ee5\u5f88\u8f7b\u677e\u5730\u6784\u5efa\u591a\u5e73\u53f0 Docker \u955c\u50cf\u3002buildx \u662f docker build ... \u547d\u4ee4\u7684\u4e0b\u4e00\u4ee3\u66ff\u4ee3\u54c1\uff0c\u5b83\u5229\u7528 BuildKit \u7684\u5168\u90e8\u529f\u80fd\u6269\u5c55\u4e86 docker build \u7684\u529f\u80fd\u3002<\/p>\n<h3>\u4f7f\u7528\u4e00\u884c\u547d\u4ee4\u5c31\u53ef\u4ee5\uff0c\u4e09\u4e2a\u5e73\u53f0\u540c\u65f6\u7f16\u8bd1\u6253\u5305\u548c\u63a8\u9001\u5230\u8fdc\u7a0b DockerHub<\/h3>\n<pre><code>docker buildx build -t hongwenjun\/nginx-php \\\n--platform=linux\/arm,linux\/arm64,linux\/amd64 . --push<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/09\/2578739230.png\" alt=\"333.png\" title=\"333.png\"><\/p>\n<h3>\u679c\u7136\u4e4b\u524d\u5b89\u88c5\u7684 <code>binfmt_misc<\/code> \u592a\u8001\u4e86\uff0c\u4e0d\u652f\u6301 Debian 11 ,\u6362\u7528\u65b0 <code>qemu-user-static<\/code>\u6210\u529f\u6784\u5efa\u591a\u5e73\u53f0 Docker \u955c\u50cf<\/h3>\n<ul>\n<li><code>BASED ON THE OFFICIAL DEBIAN CONFIGURATION DOCKER CONTAINER NGINX-PHP-FPM7.4 IMAGE<\/code><\/li>\n<li><a href=\"https:\/\/hub.docker.com\/repository\/docker\/hongwenjun\/nginx-php\">https:\/\/hub.docker.com\/repository\/docker\/hongwenjun\/nginx-php<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>debian 11 \u540e\uff0c\u4e4b\u524d\u7684 Dockerfile \u5236\u4f5c\u591a\u5e73\u53f0\u955c\u50cf, \u63d0\u793a qemu \u8fd0\u884c\u9519\u8bef,\u6362 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[15],"class_list":["post-468","post","type-post","status-publish","format-standard","hentry","category-docker","tag-docker"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=468"}],"version-history":[{"count":1,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/468\/revisions"}],"predecessor-version":[{"id":1435,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/468\/revisions\/1435"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}