From e07083fcca3f4a702aefb097df0fdca4776edf07 Mon Sep 17 00:00:00 2001 From: fly6516 Date: Tue, 25 Mar 2025 18:51:20 +0800 Subject: [PATCH] =?UTF-8?q?docs(README):=20=E6=B7=BB=E5=8A=A0=E5=A4=9A?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=9E=84=E5=BB=BA=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增"Building"章节,介绍如何使用 Docker Buildx 进行多平台构建 - 详细说明了创建和启用 Buildx 构建器、运行 QEMU 以及构建和推送多平台 Docker 镜像的步骤 --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 83ca1b4..037c829 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,23 @@ This project provides a Docker-based multi-language compile environment. It is d ### Usage Once inside the container, you can use the pre-installed compilers and tools to compile and run your projects. The working directory is set to `/workspace`. +### Building + +#### create and enable Buildx builder +```bash +docker buildx create --use +``` + +#### run QEMU to emulate multiplatform +```bash +docker run --rm --privileged fly6516.synology.me:8080/multiarch/qemu-user-static --reset -p yes +``` + +#### build and push docker image +```bash +docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x,linux/mips64le -t fly6516/multilang:latest . --push +``` + --- [中文版本](#中文版本)