{"id":7079,"date":"2024-11-14T14:27:37","date_gmt":"2024-11-14T06:27:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7079\/"},"modified":"2024-11-14T14:27:37","modified_gmt":"2024-11-14T06:27:37","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-arm-%e6%9e%b6%e6%9e%84%e4%b8%8a%e4%bd%bf%e7%94%a8%e5%ae%98%e6%96%b9-docker-mysql-%e9%95%9c%e5%83%8f%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7079\/","title":{"rendered":"\u5982\u4f55\u5728 Arm \u67b6\u6784\u4e0a\u4f7f\u7528\u5b98\u65b9 Docker-MySQL \u955c\u50cf\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173042534017753.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5728 Arm \u67b6\u6784\u4e0a\u4f7f\u7528\u5b98\u65b9 Docker-MySQL \u955c\u50cf\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5728 Arm \u67b6\u6784\u4e0a\u4f7f\u7528\u5b98\u65b9 Docker-MySQL \u955c\u50cf\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 arm \u67b6\u6784\u4e2d\u4f7f\u7528\u5b98\u65b9 &#8211; \u955c\u50cf<\/strong><\/p>\n<p><strong>\u95ee\u9898\u8bf4\u660e<\/strong><\/p>\n<p>\u76ee\u6807\u662f\u57fa\u4e8e mysql \u7684 x86 \u5b98\u65b9\u955c\u50cf\u6784\u5efa\u4e00\u4e2a\u4e0e\u4e4b\u5bf9\u5e94\u7684 arm \u67b6\u6784\u955c\u50cf\u3002\u4f46\u662f\uff0c\u5b98\u65b9 dockerfile \u5e76\u672a\u6307\u5b9a\u53ef\u7528\u4e8e arm \u67b6\u6784\u7684\u6b65\u9aa4\u3002<\/p>\n<p><strong>dockerfile \u5206\u6790<\/strong><\/p>\n<p>\u63d0\u4f9b\u7684 dockerfile \u63ed\u793a\u4e86\u6784\u5efa\u955c\u50cf\u6240\u9700\u7684\u6587\u4ef6\u548c\u6307\u4ee4\uff1a<\/p>\n<ul>\n<li>file:702017714ad3e1567b4f60b688750f8b631d91088e4dcf41351c4bb07749c579\uff1a\u8fd9\u662f layers \u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u6784\u5efa\u955c\u50cf\u6240\u9700\u7684\u6240\u6709\u6587\u4ef6\u548c\u5143\u6570\u636e\u3002<\/li>\n<li>file:e9a583a365264f0f565259ffd0f19e5199ef4351d098f75af32f633c0d6cbe73\uff1a\u8fd9\u662f\u811a\u672c\u5165\u53e3\u70b9\u6587\u4ef6\uff0c\u7528\u4e8e\u542f\u52a8 mysql \u670d\u52a1\u3002<\/li>\n<\/ul>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u867d\u7136 dockerfile \u4e0d\u63d0\u4f9b\u6784\u5efa arm \u955c\u50cf\u7684\u660e\u786e\u6b65\u9aa4\uff0c\u4f46\u5efa\u8bae\u4f7f\u7528\u65b0\u4e00\u4ee3\u7684 docker \u6784\u5efa\u5de5\u5177 buildx \u6765\u5b9e\u73b0\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5 buildx \u5de5\u5177\uff1a<\/strong><\/p>\n<pre># linux\ncurl -sl https:\/\/github.com\/docker\/buildx\/releases\/latest\/download\/buildx-linux-x86_64 -o buildx\nchmod +x buildx\nsudo mv buildx \/usr\/local\/bin\n\n# macos\nbrew install docker\/buildx\/buildx<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>\u521b\u5efa\u6784\u5efa\u5668\uff1a<\/strong><\/p>\n<pre>buildx create builder --name my-arm-builder --platform linux\/arm64 --append<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>\u6784\u5efa arm \u955c\u50cf\uff1a<\/strong><\/p>\n<pre>buildx build --platform linux\/arm64 -t my-arm-mysql-image .<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5728 Arm \u67b6\u6784\u4e0a\u4f7f\u7528\u5b98\u65b9 Docker-MySQL \u955c\u50cf\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728 arm \u67b6\u6784\u4e2d\u4f7f\u7528\u5b98\u65b9 &#8211; \u955c\u50cf \u95ee\u9898\u8bf4\u660e \u76ee\u6807\u662f\u57fa\u4e8e mysql \u7684 x86 \u5b98\u65b9\u955c\u50cf\u6784\u5efa\u4e00\u4e2a\u4e0e\u4e4b\u5bf9\u5e94\u7684 arm \u67b6\u6784\u955c\u50cf\u3002\u4f46\u662f\uff0c\u5b98\u65b9 dockerfile \u5e76\u672a\u6307\u5b9a\u53ef\u7528\u4e8e arm \u67b6\u6784\u7684\u6b65\u9aa4\u3002 dockerfile \u5206\u6790 \u63d0\u4f9b\u7684 dockerfile \u63ed\u793a\u4e86\u6784\u5efa\u955c\u50cf\u6240\u9700\u7684\u6587\u4ef6\u548c\u6307\u4ee4\uff1a file:702017714ad3e1567b4f60b688750f8b631d91088e4dcf41351c4bb07749c579\uff1a\u8fd9\u662f layers \u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u6784\u5efa\u955c\u50cf\u6240\u9700\u7684\u6240\u6709\u6587\u4ef6\u548c\u5143\u6570\u636e\u3002 file:e9a583a365264f0f565259ffd0f19e5199ef4351d098f75af32f633c0d6cbe73\uff1a\u8fd9\u662f\u811a\u672c\u5165\u53e3\u70b9\u6587\u4ef6\uff0c\u7528\u4e8e\u542f\u52a8 mysql \u670d\u52a1\u3002 \u89e3\u51b3\u65b9\u6848 \u867d\u7136 dockerfile \u4e0d\u63d0\u4f9b\u6784\u5efa arm \u955c\u50cf\u7684\u660e\u786e\u6b65\u9aa4\uff0c\u4f46\u5efa\u8bae\u4f7f\u7528\u65b0\u4e00\u4ee3\u7684 docker \u6784\u5efa\u5de5\u5177 buildx \u6765\u5b9e\u73b0\u4ee5\u4e0b\u6b65\u9aa4\uff1a \u5b89\u88c5 buildx \u5de5\u5177\uff1a # linux curl -sl https:\/\/github.com\/docker\/buildx\/releases\/latest\/download\/buildx-linux-x86_64 -o buildx chmod +x buildx sudo mv buildx \/usr\/local\/bin [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-7079","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=7079"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7079\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}