docs(README): 更新项目文档以反映新的定位和使用方式
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 11s

- 修改项目名称为 "Multi-Language Compile Environment"
- 移除多架构构建相关内容
- 更新构建和运行步骤说明
- 调整使用方法描述,强调容器内的开发和编译功能
This commit is contained in:
fly6516 2025-03-05 14:12:29 +08:00
parent 46b2327c7f
commit 166938d9f1

View File

@ -1,5 +1,5 @@
# Multi-Lang / 多语言项目 # Multi-Language Compile Environment / 多语言编译环境
[English Version](#english-version) | [中文版本](#中文版本) [English Version](#english-version) | [中文版本](#中文版本)
@ -9,34 +9,26 @@
<a id="english-version"></a> <a id="english-version"></a>
### Overview ### 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. This project provides a Docker-based multi-language compile environment. It is designed to support development in various programming languages such as C/C++, Java, Python, Node.js, Go, Rust, Ruby, PHP, Haskell, Perl, Lua, and .NET.
### Prerequisites ### Prerequisites
- Docker (with Buildx support) - Docker (with Buildx support if needed)
- QEMU for multi-architecture emulation - Internet access to download dependencies
### Build Instructions ### Build Instructions
1. **Build the Docker image:**
1. **Create and Enable Buildx Builder** Execute the following command in the project directory:
Create a new Buildx builder instance and switch to it:
```bash ```bash
docker buildx create --use docker build -t multi-lang .
``` ```
2. **Run the container:**
2. **Start QEMU Multi-Architecture Emulator** Start a container with:
Run the following command to start QEMU with multi-arch support:
```bash ```bash
docker run --rm --privileged fly6516.synology.me:8080/multiarch/qemu-user-static --reset -p yes docker run -it --rm multi-lang
```
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 ### Usage
After pushing the image, you can deploy it on the supported platforms using your preferred orchestration tools. 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`.
--- ---
@ -48,36 +40,28 @@ After pushing the image, you can deploy it on the supported platforms using your
<a id="中文版本"></a> <a id="中文版本"></a>
### 概述 ### 概述
Multi-Lang 是一个 Docker 多架构构建项目,展示了如何利用 Docker Buildx 与 QEMU 构建并推送支持多种平台的 Docker 镜像 该项目构建了一个基于 Docker 的多语言编译环境,支持 C/C++、Java、Python、Node.js、Go、Rust、Ruby、PHP、Haskell、Perl、Lua 以及 .NET 等多种语言的开发和编译
### 前提条件 ### 前提条件
- 安装支持 Buildx 的 Docker - 安装 Docker如果需要可支持 Buildx
- 配置 QEMU 以支持多架构模拟 - 具备下载依赖的网络环境
### 编译步骤 ### 构建步骤
1. **构建 Docker 镜像:**
1. **创建并启用 Buildx 构建器** 在项目目录下执行:
创建一个新的 Buildx 构建器实例并切换到该实例:
```bash ```bash
docker buildx create --use docker build -t multi-lang .
``` ```
2. **运行容器:**
2. **启动 QEMU 多架构模拟器** 使用以下命令启动容器:
执行以下命令以启动 QEMU 多架构支持:
```bash ```bash
docker run --rm --privileged fly6516.synology.me:8080/multiarch/qemu-user-static --reset -p yes docker run -it --rm multi-lang
```
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
``` ```
### 使用方法 ### 使用方法
镜像推送成功后,您可以使用您偏好的编排工具在各个平台上进行部署 进入容器后,所有的编译器与工具已经预先安装好,工作目录为 `/workspace`,可以直接在此目录下进行项目的开发和编译。
--- ---
[English Version](#english-version) [English Version](#english-version)
``` ```