在M1处理器中运行的Docker映像 [英] Docker image run in m1 processor
问题描述
我只能在具有docker Preview的macbook air m1中播放,并且无法通过docker-compose文件运行8.0.22版的mysql映像.
I can only play in my macbook air m1 with docker preview and i can't run an image of mysql with version 8.0.22 through a docker-compose file.
我运行的命令是: docker-compose up -d mysql
我该如何解决这个问题?
How can I solve this problem?
推荐答案
M1是ARMv8(aarch64)架构,大多数映像是X86(amd64).基于 bitfmt
的整个仿真过程(允许从其他体系结构运行容器)对于ARMv8 Mac版Docker来说仍然不稳定,因此您需要等待一段时间.
M1 is ARMv8 (aarch64) architecture and majority of the images are X86 (amd64). The whole emulation process based on bitfmt
that allows to run containers from another architecture is still not stable for the ARMv8 release of Docker for Mac, so you would need to wait some time.
克服此问题的一种方法是通过从某些Linux发行版(如 alpine
, debian)开始为ARM64构建自己的
, mysql
映像. ubuntu
并安装mysql服务器(与裸机安装相同).
One way to overcome this problem is to build your own image of mysql
for ARM64, by starting from some of the linux distributions such as alpine
, debian
, ubuntu
and installing the mysql servers (same as you would have done on a bare-metal installation).
您可以在docker hub中找到很多标记为 ARM64v8 的容器这可能是创建图像的良好起点.
You can find lot's of containers that are already available in docker hub marked as ARM64v8 so this can be a good starting point to create your image.
这篇关于在M1处理器中运行的Docker映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!