在容器镜像存储库为默认值后,将复杂的 scaffolded Docker-buildx 简化为简单的 Docker build --platform
Docker buildx/BuildKit is not deprecated — it's the default builder. This issue is only about simplifying our multi-arch scaffold later, once upstream Docker makes it possible everywhere. Filing it so we don't miss the window. Current scaffold (keep as-is for noes buildx create (Docker-containerdriver) + a Dockerfile.cross sed + --platform … --push + buildx rm. This works on both image stores (overlay2 and containerd), whipped to unknown environments needs. Target. With the containerd image s--platform=linux/amd64,linux/arm64--push . does multi-arch with no buildx create and no Dockerfile.cross. We can drop all that once we can rely on it. Do this when ALL of these upstream conditions land — watch these: - [ ] A. containerd image store is the default in Docker Engine (not just fresh installs / not experimental) → watch Docker/roadmap#371 (https://GitHub.com/Docker/roadmap/issues/371) and moby/moby discussion #48085 (https://GitHub.com/moby/moby/discussions/48085) - [ ] B. CI runners ship it by default (e.g. GitHub ubuntu-latest daemon uses the containerd store) → watch actions/runner-images (https://GitHub.com/actions/runner-images) release notes (no dedicated tracker yet) - [ ] C. our minimum supported Docker is new enough / classic builder retired → watch moby/moby#40379 (https://GitHub.com/moby/moby/issues/40379) and Docker/cli deprecated.md (https://GitHub.com/Docker/cli/blob/master/docs/deprecated.md) Then: - Replace the Docker-buildx recipe with Docker build --platform=$(PLATFORMS) --push … - Remove buildx create/use/rm and the Dockerfile.cross sed - Keep Docker-build for single-arch Ref: #2175, #4560 · multi-platform docs (https://docs.Docker.com/build/building/multi-platform/) · containerd image store (https://docs.Docker.com/engine/storage/containerd/) Sources: Docker/roadmap#371 (https://GitHub.com/Docker/roadmap/issues/371), moby/moby#48085 (https://GitHub.com/moby/moby/discussions/48085), moby/moby#40379 (https://GitHub.com/moby/moby/issues/40379), Docker/cli deprecated.md (https://GitHub.com/Docker/cli/blob/master/docs/deprecated.md), kubebuilder #2175 (https://GitHub.com/Kubernetes-sigs/kubebuilder/issues/2175), kubebuilder #4560 (https://GitHub.com/Kubernetes-sigs/kubebuilder/issues/4560)
内容来源: kubernetes-sigs/kubebuilder