From 46b2327c7fadd29c07855913d19e8048ce971ec2 Mon Sep 17 00:00:00 2001 From: fly6516 Date: Wed, 5 Mar 2025 14:02:34 +0800 Subject: [PATCH] =?UTF-8?q?docs(README):=20=E6=9B=B4=E6=96=B0=E5=A4=9A?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E9=A1=B9=E7=9B=AE=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加英文版本说明- 补充中文版本内容- 详细描述项目概述、前提条件、编译步骤和使用方法 - 优化文档结构,增加目录链接 --- README.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ddc6aba..5c7e468 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,83 @@ -# Multi-Lang -multi-lang-dev +# Multi-Lang / 多语言项目 -# 编译 +[English Version](#english-version) | [中文版本](#中文版本) -# 创建并启用 Buildx 构建器 -docker buildx create --use +--- -# 启动 QEMU 支持的多架构模拟器 -docker run --rm --privileged fly6516.synology.me:8080/multiarch/qemu-user-static --reset -p yes +## English Version + -# 构建并推送多架构 Docker 镜像 -docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x,linux/mips64le -t fly6516.synology.me:8080/multilang:latest . --push \ No newline at end of file +### Overview +Multi-Lang is a Docker multi-architecture build project that demonstrates how to build and push Docker images for various platforms. This project leverages Docker Buildx and QEMU for cross-platform builds. + +### Prerequisites +- Docker (with Buildx support) +- QEMU for multi-architecture emulation + +### Build Instructions + +1. **Create and Enable Buildx Builder** + Create a new Buildx builder instance and switch to it: + ```bash + docker buildx create --use + ``` + +2. **Start QEMU Multi-Architecture Emulator** + Run the following command to start QEMU with multi-arch support: + ```bash + docker run --rm --privileged fly6516.synology.me:8080/multiarch/qemu-user-static --reset -p yes + ``` + +3. **Build and Push Multi-Arch Docker Image** + Build your Docker image for multiple architectures and push it to the registry: + ```bash + docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x,linux/mips64le -t fly6516.synology.me:8080/multilang:latest . --push + ``` + +### Usage +After pushing the image, you can deploy it on the supported platforms using your preferred orchestration tools. + +--- + +[中文版本](#中文版本) + +--- + +## 中文版本 + + +### 概述 +Multi-Lang 是一个 Docker 多架构构建项目,展示了如何利用 Docker Buildx 与 QEMU 构建并推送支持多种平台的 Docker 镜像。 + +### 前提条件 +- 安装支持 Buildx 的 Docker +- 配置 QEMU 以支持多架构模拟 + +### 编译步骤 + +1. **创建并启用 Buildx 构建器** + 创建一个新的 Buildx 构建器实例并切换到该实例: + ```bash + docker buildx create --use + ``` + +2. **启动 QEMU 多架构模拟器** + 执行以下命令以启动 QEMU 多架构支持: + ```bash + docker run --rm --privileged fly6516.synology.me:8080/multiarch/qemu-user-static --reset -p yes + ``` + +3. **构建并推送多架构 Docker 镜像** + 针对多个平台构建 Docker 镜像,并将其推送到镜像仓库: + ```bash + docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x,linux/mips64le -t fly6516.synology.me:8080/multilang:latest . --push + ``` + +### 使用方法 +镜像推送成功后,您可以使用您偏好的编排工具在各个平台上进行部署。 + +--- + +[English Version](#english-version) +```