Docker image run in m1 processor(在 m1 处理器中运行的 Docker 镜像)
问题描述
我只能在我的 macbook air m1 上使用 docker preview 玩,我不能通过 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 集
我运行的命令是:docker-compose up -d mysql
我该如何解决这个问题?
How can I solve this problem?
推荐答案
我们刚刚遇到了这个问题,我从 这个答案.你可以在 docker-compose
文件中指定你的平台,所以在你的情况下它看起来像:
We've just ran into this issue, and I took the solution from this answer. You can specify your platform in the docker-compose
file, so in your case it would look like:
services:
mysql:
image: mysql:8.0.22
platform: linux/x86_64
container_name: mysqldb
restart: always
ports:
- 3306:3306
volumes:
- mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=test
- MYSQL_DATABASE=DATA
在我们公司,我们使用 M1 和 Intel Mac,此解决方案使 mysql 映像可用于两者.
In our company, we use M1 and Intel Macs and this solution makes mysql image available for both.
这篇关于在 m1 处理器中运行的 Docker 镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 m1 处理器中运行的 Docker 镜像


基础教程推荐
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01