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

能不能把docker的arm镜像和x64镜像合并到一起 我知道合并的命令 #12

Open
david88558855 opened this issue Sep 19, 2024 · 3 comments

Comments

@david88558855
Copy link

david88558855 commented Sep 19, 2024

能不能把docker的arm镜像和x64镜像合并到一起变成多架构latest镜像 我知道合并的命令现在就放上来
docker manifest create snltty/linker-musl:latest
snltty/linker-musl:x64 snltty/linker-musl:arm64 &&
docker manifest push snltty/linker-musl:latest &&
docker manifest rm snltty/linker-musl:latest

@snltty
Copy link
Owner

snltty commented Sep 19, 2024

还可以这样吗, 我尝试一下

@david88558855
Copy link
Author

david88558855 commented Sep 19, 2024

还可以这样吗, 我尝试一下

这个需要先把 你的镜像名字修改成一样的用TAG来区分然后普通上传到仓库 再执行我给出的这种命令来合并创建清单 ,关于你这个清单命令你可以百度收索下就知道是什么意思了 主要就是把单一镜像不同架构不同TAG的合并成一个可以根据机器架构自适应拉取的清单镜像 我自己制作的镜像都是通过这个方法来弄得 haoxuan8855/linker 这是我把你这个镜像合并后的结果你可以看看

@david88558855
Copy link
Author

还可以这样吗, 我尝试一下
这是我利用github工作流的方法来做合并arm64和x64的docker镜像的方法 你可以参考参考
- name: Pull and push snltty/linker-musl-x64 image
run: |
docker pull --platform linux/amd64 snltty/linker-musl-x64:latest
docker tag snltty/linker-musl-x64:latest haoxuan8855/linker:x64
docker push haoxuan8855/linker:x64

- name: Pull and push snltty/linker-musl-arm64 image
  run: |
    docker pull --platform linux/arm64 snltty/linker-musl-arm64:latest
    docker tag snltty/linker-musl-arm64:latest haoxuan8855/linker:arm64
    docker push haoxuan8855/linker:arm64

- name: Build and push Docker images
  run: |
    docker pull --platform linux/amd64 haoxuan8855/linker:x64 && \
    docker push haoxuan8855/linker:x64 && \
    docker pull --platform linux/arm64 haoxuan8855/linker:arm64 && \
    docker push haoxuan8855/linker:arm64 && \
    docker manifest create haoxuan8855/linker:latest haoxuan8855/linker:x64 haoxuan8855/linker:arm64 && \
    docker manifest push haoxuan8855/linker:latest

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

2 participants