Support multi-platform

未关闭
#2 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
docker, dockerfile, github-actions, nodejs, python

调研方向

检查 Dockerfile 和仓库现有的镜像构建配置,然后将其与 issue 中的 QEMU、Buildx 和 build-push-action 示例进行比较。当镜像针对 amd64、arm64 和 ppc64le 平台完成构建并推送,同时保留现有标签时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug Hacktoberfest help wanted

The comments on the Docker for Mac issue suggests container authors should make containers multi-platform: docker/for-mac#5123 (comment)

By: @stephen-turner

This is a qemu bug, which is the upstream component we use for running Intel (amd64) containers on M1 (arm64) chips, and is unfortunately not something we control. In general, we recommend running arm64 containers on M1 chips because (even ignoring any crashes) they will always be faster and use less memory.

Please encourage the author of this container to supply an arm64 or multi-arch image, not just an Intel one. Now that M1 is a mainstream platform, we think that most container authors will be keen to do this.

Set up QEMU

The docker/setup-qemu action installs QEMU static binaries, which are used to run builders for architectures other than the host.

- name: Set up QEMU
  uses: docker/setup-qemu-action@master
  with:
    platforms: all
Set up Docker builders

The docker/setup-buildx action configures buildx, which is a Docker CLI plugin that provides enhanced build capabilities. This is the infrastructure that the following step will use for actually building images.

- name: Set up Docker Buildx
  id: buildx
  uses: docker/setup-buildx-action@master
Build and push the images

This final step uses the [docker/build-push-action][] to build the images and push them to Docker Hub using the tags we defined in the prep step. In this example, we’re building images for amd64, arm64, and ppc64le architectures.

  - name: Build
    uses: docker/build-push-action@v2
    with:
      builder: ${{ steps.buildx.outputs.name }}
      context: .
      file: ./Dockerfile
      platforms: linux/amd64,linux/arm64,linux/ppc64le
      push: true
      tags: ${{ steps.prep.outputs.tags }}
References
主要语言
Dockerfile
星标
1
派生
5
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。