Skip to content

Docker镜像在Windows AMD64架构下启动失败:exec format error #272

@wzgrx

Description

@wzgrx

复现步骤

. 打开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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions