docs(README): 更新多语言项目文档
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 11s
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 11s
- 添加英文版本说明- 补充中文版本内容- 详细描述项目概述、前提条件、编译步骤和使用方法 - 优化文档结构,增加目录链接
This commit is contained in:
parent
c5e7f09649
commit
46b2327c7f
87
README.md
87
README.md
@ -1,14 +1,83 @@
|
|||||||
# Multi-Lang
|
|
||||||
|
|
||||||
multi-lang-dev
|
# Multi-Lang / 多语言项目
|
||||||
|
|
||||||
# 编译
|
[English Version](#english-version) | [中文版本](#中文版本)
|
||||||
|
|
||||||
# 创建并启用 Buildx 构建器
|
---
|
||||||
docker buildx create --use
|
|
||||||
|
|
||||||
# 启动 QEMU 支持的多架构模拟器
|
## English Version
|
||||||
docker run --rm --privileged fly6516.synology.me:8080/multiarch/qemu-user-static --reset -p yes
|
<a id="english-version"></a>
|
||||||
|
|
||||||
# 构建并推送多架构 Docker 镜像
|
### Overview
|
||||||
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
|
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.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[中文版本](#中文版本)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 中文版本
|
||||||
|
<a id="中文版本"></a>
|
||||||
|
|
||||||
|
### 概述
|
||||||
|
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)
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user