相关疑难解决方法(0)

运行使用 Apple M1 芯片(基于 ARM 的系统)构建的容器时出现“exec 格式错误”

预期行为:我可以运行使用 Apple M1 芯片构建的容器。

\n

观察到的行为:

\n

假设您有 Google Cloud Run 帐户并且可以将 Docker 镜像推送到 Google Container Registry。我在这个例子中使用https://github.com/seenickcode/trivial-go-api

\n
    \n
  1. `git克隆git@github.com:seenickcode/trivial-go-api.git\'
  2. \n
  3. cd trivial-go-api
  4. \n
  5. docker build -t gcr.io/<YOUR GCR PROJECT ID>/example .
  6. \n
  7. docker push -t gcr.io/<YOUR GCR PROJECT ID>/example
  8. \n
  9. 转到console.cloud.google.comGoogle Cloud Run > 创建新服务 > 选择推送的 Docker 映像(包含所有默认选项)> 运行
  10. \n
  11. 显示错误:
  12. \n
\n
Cloud Run error: Container failed to start. \nFailed to start and then listen on the port defined by the PORT environment …
Run Code Online (Sandbox Code Playgroud)

macos docker google-cloud-run

35
推荐指数
2
解决办法
3万
查看次数

标签 统计

docker ×1

google-cloud-run ×1

macos ×1