复现步骤
. 打开PowerShell
. 执行命令:docker run -p 7891:7891 cft0808/sansheng-demo
. 观察到错误:exec /usr/local/bin/python3: exec format error
预期与实际结果
已尝试的解决方法
- 尝试使用
--platform linux/amd64参数:docker run --platform linux/amd64 -p 7891:7891 cft0808/sansheng-demo
- 尝试安装QEMU用户态模拟器
环境信息
- 操作系统:Windows 11 22H2
- Docker版本:24.0.5
- CPU架构:Intel Core i7-11800H (AMD64)
- WSL2:已启用
- 错误日志:
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
exec /usr/local/bin/python3: exec format error
复现步骤
. 打开PowerShell
. 执行命令:
docker run -p 7891:7891 cft0808/sansheng-demo. 观察到错误:
exec /usr/local/bin/python3: exec format error预期与实际结果
已尝试的解决方法
--platform linux/amd64参数:docker run --platform linux/amd64 -p 7891:7891 cft0808/sansheng-demo环境信息
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
exec /usr/local/bin/python3: exec format error