Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M1的Mac构建兼容Linux的Docker image #90

Open
Topppy opened this issue Dec 13, 2023 · 0 comments
Open

M1的Mac构建兼容Linux的Docker image #90

Topppy opened this issue Dec 13, 2023 · 0 comments

Comments

@Topppy
Copy link
Owner

Topppy commented Dec 13, 2023

前置信息:

  1. M1的Mac docker build出的image的platform是: linux/arm64/v8
  2. linux和老版mac的platform是:linux/amd64

所以m1的mac上build出来image在linux上用不了。
那么如何构建linux支持的platform的image呢?
使用参数 --platform 来指定platform linux/amd64

docker build -t IMAGE:TAG  --platform linux/amd64  .

打完的image在docker的GUI中查看会有一个特殊的标志
image

附gitlabCI报错信息:

ERROR: Job failed (system failure): unable to upgrade connection: container not found ("build")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant