Compare commits

...

51 Commits
slim ... main

Author SHA1 Message Date
e07083fcca docs(README): 添加多平台构建说明
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 0s
- 新增"Building"章节,介绍如何使用 Docker Buildx 进行多平台构建
- 详细说明了创建和启用 Buildx 构建器、运行 QEMU 以及构建和推送多平台 Docker 镜像的步骤
2025-03-25 18:51:20 +08:00
f37b9b1735 docs(README): 更新 slim 和 max 版本说明
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 0s
在 README.md 文件中添加了关于 slim 和 max 版本的警告信息,说明这些版本由于 latest 镜像的优化已被暂时搁置,可能存在 Bug,不建议使用。同时更新了英文和中文版本的内容。
2025-03-25 18:46:58 +08:00
778d6f888c Merge remote-tracking branch 'origin/main'
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 0s
2025-03-25 18:38:33 +08:00
cec89737dc docs(README): 更新多语言 Docker 环境的使用说明- 在 README 中添加了 Docker Hub 镜像链接
-增加了预构建镜像的使用方法说明
- 优化了中英文版本的说明内容,使其更加清晰易懂
2025-03-25 18:37:12 +08:00
1d1af1bebf docs update README.md
All checks were successful
build-docker-images-for-latest-release / build-and-push (push) Successful in 21s
2025-03-05 23:58:12 +08:00
166938d9f1 docs(README): 更新项目文档以反映新的定位和使用方式
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 11s
- 修改项目名称为 "Multi-Language Compile Environment"
- 移除多架构构建相关内容
- 更新构建和运行步骤说明
- 调整使用方法描述,强调容器内的开发和编译功能
2025-03-05 14:12:29 +08:00
46b2327c7f docs(README): 更新多语言项目文档
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 11s
- 添加英文版本说明- 补充中文版本内容- 详细描述项目概述、前提条件、编译步骤和使用方法
- 优化文档结构,增加目录链接
2025-03-05 14:02:34 +08:00
c5e7f09649 docs: fix md
All checks were successful
build-docker-images-for-latest-release / build-and-push (push) Successful in 15s
2025-01-01 10:08:32 +08:00
2c9aff09e2 docs:add compile guide
All checks were successful
build-docker-images-for-latest-release / build-and-push (push) Successful in 18s
2025-01-01 08:58:45 +08:00
c77ef273c1 ci:enabled main.yaml
All checks were successful
build-docker-images-for-latest-release / build-and-push (push) Successful in 13m33s
2025-01-01 08:21:28 +08:00
3a2f4db40b ci:enabled main.yaml 2025-01-01 08:21:13 +08:00
6ab4244da7 feat:remove files
Some checks failed
build-docker-images-for-multi-latest-release / build-and-push (push) Failing after 3m50s
2025-01-01 08:20:28 +08:00
4659271756 feat:support multi platform
Some checks failed
build-docker-images-for-multi-latest-release / build-and-push (push) Failing after 3m45s
2025-01-01 08:15:10 +08:00
bfbce4dde8 ci: remove sed
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 46s
2025-01-01 08:07:22 +08:00
69ab6c9f11 ci: add arm/v7 support
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 1m34s
2025-01-01 08:04:02 +08:00
ee1e735c36 ci: remove arm/v7 support
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 36s
2025-01-01 08:01:37 +08:00
33a7d9a4fd ci: remove qemu
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 3m48s
2025-01-01 07:54:10 +08:00
587b4c169c ci: fix bugs again
Some checks failed
build-docker-images-for-multi-latest-release / build-and-push (push) Failing after 3m35s
2025-01-01 07:48:06 +08:00
d68c17e0d7 ci: fix bugs
Some checks failed
build-docker-images-for-multi-latest-release / build-and-push (push) Has been cancelled
2025-01-01 07:41:10 +08:00
bb55a68ab2 ci: fix qemu run
Some checks failed
build-docker-images-for-multi-latest-release / build-and-push (push) Has been cancelled
2025-01-01 07:40:14 +08:00
49803cb263 ci: fix qemu image run
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 3m47s
2025-01-01 07:28:16 +08:00
243e875e1d ci: fix bugs again
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Has been cancelled
2025-01-01 07:24:45 +08:00
ed22a73eda ci: fix bugs
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 22s
2025-01-01 07:23:25 +08:00
347a24a43a ci: add perpulled images
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 3m45s
2025-01-01 07:18:43 +08:00
d2c5264c79 ci: enabled qemu
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Has been cancelled
2025-01-01 07:08:53 +08:00
00955c3f11 ci: add mirror
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 3m29s
2025-01-01 06:59:13 +08:00
fae8a526f4 ci: disable main and add multi compiler
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Has been cancelled
2025-01-01 06:58:16 +08:00
84571ff0f7 ci: del multiversion support
All checks were successful
build-docker-images-for-latest-release / build-and-push (push) Successful in 12m17s
2025-01-01 06:31:24 +08:00
b53cb9a8d3 ci: move files
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 4m3s
2025-01-01 06:24:05 +08:00
04b6122ea2 ci: del unnecessary image
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Waiting to run
build-docker-images-for-latest-release-github-ver / build-and-push (push) Has been cancelled
2025-01-01 06:22:23 +08:00
46b2c66a60 ci: give up build-push-action
Some checks are pending
build-docker-images-for-latest-release / build-and-push (push) Waiting to run
2025-01-01 06:19:50 +08:00
6c4dbe59e3 feat: rollback dockerp.com to ensure workflows
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 4m12s
2025-01-01 05:56:55 +08:00
591c04f583 feat: del dockerp.com to ensure workflows
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 6m4s
2025-01-01 05:48:25 +08:00
0c116b8dd0 ci: remove mirror registry settings
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 2m0s
2025-01-01 05:43:30 +08:00
f4696f84f5 ci: fix wrong context
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 2m14s
2025-01-01 01:34:51 +08:00
152d4e73ff ci: del extra https
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 1m0s
2025-01-01 01:31:58 +08:00
dc770c6245 ci: add missing https
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 1m49s
2025-01-01 01:28:57 +08:00
17f1c3beac ci: add check for pulling image
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 2m57s
2025-01-01 01:19:31 +08:00
98a77e6a69 ci: del cache for docker image
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 3m24s
2025-01-01 01:14:21 +08:00
99330cdbbe ci: add cache for docker image
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Has been cancelled
2024-12-29 13:04:19 +08:00
7c663d7600 ci: add correct pwd and user
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 3m39s
2024-12-29 12:58:24 +08:00
c732cd937c ci: pre pulled image
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 57s
2024-12-29 11:32:58 +08:00
13594a37cb ci: fix restart docker
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 1m51s
2024-12-29 11:30:42 +08:00
d17b7bf999 ci: add check for mirror registry
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 1m53s
2024-12-29 11:24:35 +08:00
330795d4ed ci: fix more commands again
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 1m21s
2024-12-29 11:20:03 +08:00
3e74378fa7 ci: fix more commands
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Has been cancelled
2024-12-29 11:18:32 +08:00
0e0f846eb1 ci: fix commands
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 16s
2024-12-29 11:16:42 +08:00
22ea406d97 ci: fix no daemon.json
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 12s
2024-12-29 11:14:27 +08:00
704c073a44 ci: change procedure
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 12s
2024-12-29 11:11:46 +08:00
96b34af4c3 ci: add mirror for registry
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 1m46s
2024-12-29 11:04:44 +08:00
a8f1f9d5ed ci: add new workflow to build latest image
Some checks failed
build-docker-images-for-latest-release / build-and-push (push) Failing after 2m44s
2024-12-29 10:59:06 +08:00
4 changed files with 269 additions and 3 deletions

View File

@ -0,0 +1,93 @@
name: build-docker-images-for-multi-latest-release
#on:
# push:
# branches:
# - main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: http://fly6516.synology.me:4000/Gitea_Action/checkout@v2
# Pre-pull Ubuntu images and push to private registry
- name: Pre-pull and Push Ubuntu Images
run: |
UBUNTU_VERSIONS=("18.04" "20.04" "22.04")
for version in "${UBUNTU_VERSIONS[@]}"; do
IMAGE_NAME="dockerp.com/ubuntu:$version"
TARGET_NAME="fly6516.synology.me:8080/ubuntu:$version"
# Pull the image from Docker Hub if not already exists locally
if ! docker image inspect "$IMAGE_NAME" > /dev/null 2>&1; then
echo "Pulling $IMAGE_NAME from Docker Hub..."
docker pull "$IMAGE_NAME"
else
echo "$IMAGE_NAME already exists locally."
fi
# Tag and push to the private registry
docker tag "$IMAGE_NAME" "$TARGET_NAME"
docker push "$TARGET_NAME"
done
# Pre-pull QEMU and Buildx images
- name: Pre-pull QEMU and Buildx Images
run: |
# Define the images to pull
QEMU_IMAGE="dockerp.com/multiarch/qemu-user-static:latest"
BUILDX_IMAGE="dockerp.com/moby/buildkit:buildx-stable-1"
# Check and pull multiarch/qemu-user-static if not exists
if ! docker image inspect "$QEMU_IMAGE" > /dev/null 2>&1; then
echo "Pulling $QEMU_IMAGE..."
docker pull "$QEMU_IMAGE"
else
echo "$QEMU_IMAGE already exists locally."
fi
# Check and pull buildkit/buildx-stable-1 if not exists
if ! docker image inspect "$BUILDX_IMAGE" > /dev/null 2>&1; then
echo "Pulling $BUILDX_IMAGE..."
docker pull "$BUILDX_IMAGE"
else
echo "$BUILDX_IMAGE already exists locally."
fi
# Set up Docker Buildx
- name: Set up Docker Buildx
uses: http://fly6516.synology.me:4000/docker/setup-buildx-action@v2
# Log in to Gitea Docker Registry
- name: Log in to Gitea Docker Registry
uses: http://fly6516.synology.me:4000/docker/login-action@v2
with:
registry: https://fly6516.synology.me:8080
username: ${{ secrets.DOCKER_SYN_USER }}
password: ${{ secrets.DOCKER_SYN_PWD }}
# Set Docker Timeout
- name: Set Docker Timeout
run: |
echo "DOCKER_CLIENT_TIMEOUT=300" >> $GITHUB_ENV
echo "DOCKER_BUILD_TIMEOUT=300" >> $GITHUB_ENV
# Build and push the Docker image for all platforms (including multi-architecture support)
- name: Build and Push Multi-Platform Docker Image
uses: http://fly6516.synology.me:4000/docker/build-push-action@v4
with:
push: true
tags: fly6516.synology.me:8080/multilang:latest
context: .
file: ./Dockerfile # Ensure this points to the correct Dockerfile location
platforms: linux/amd64,linux/arm64,linux/arm/v7
# Optional: Verify the pushed image
- name: Verify Docker Image
run: |
docker pull fly6516.synology.me:8080/multilang:latest
docker run --rm fly6516.synology.me:8080/multilang:latest bash -c "echo 'Image verified'"

View File

@ -0,0 +1,53 @@
name: build-docker-images-for-latest-release
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: http://fly6516.synology.me:4000/Gitea_Action/checkout@v2
# # Pre-pull image if needed
# - name: Pre Pull Image if Needed
# run: |
# IMAGE_NAME="dockerp.com/moby/buildkit:buildx-stable-1"
# if ! docker image inspect "$IMAGE_NAME" > /dev/null 2>&1; then
# echo "Image does not exist locally. Pulling..."
# docker pull "$IMAGE_NAME"
# else
# echo "Image already exists locally."
# fi
# Log in to Gitea Docker Registry
- name: Log in to Gitea Docker Registry
run: |
echo ${{ secrets.DOCKER_SYN_PWD }} | docker login https://fly6516.synology.me:8080 -u ${{ secrets.DOCKER_SYN_USER }} --password-stdin
# Set Docker Timeout
- name: Set Docker Timeout
run: |
echo "DOCKER_CLIENT_TIMEOUT=300" >> $GITHUB_ENV
echo "DOCKER_BUILD_TIMEOUT=300" >> $GITHUB_ENV
# Build the Docker image
- name: Build Docker Image
run: |
docker build -t fly6516.synology.me:8080/multilang:latest .
# Push the Docker image
- name: Push Docker Image
run: |
docker push fly6516.synology.me:8080/multilang:latest
# Optional: Verify the pushed image
- name: Verify Docker Image
run: |
docker pull fly6516.synology.me:8080/multilang:latest
docker run --rm fly6516.synology.me:8080/multilang:latest bash -c "echo 'Image verified'"

View File

@ -3,11 +3,17 @@
# ENTRYPOINT ["top", "-b"]
# 使用 Ubuntu 作为基础镜像
FROM dockerp.com/ubuntu:20.04
FROM fly6516.synology.me:8080/ubuntu:20.04
#FROM ubuntu:20.04
# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
## 安装 QEMU 模拟器,支持多架构构建
#RUN apt-get update && apt-get install -y \
# qemu-user-static \
# && rm -rf /var/lib/apt/lists/*
# 使用南京大学的 apt 源
RUN sed -i 's/archive.ubuntu.com/mirrors.nju.edu.cn/g' /etc/apt/sources.list

118
README.md
View File

@ -1,3 +1,117 @@
# Multi-Lang
multi-lang-dev
# Multi-Language Compile Environment / 多语言编译环境
[English Version](#english-version) | [中文版本](#中文版本)
---
## English Version
<a id="english-version"></a>
> ❗️ **Warning** > The `slim` and `max` versions and their branches have been temporarily put on hold due to optimizations in the `latest` image (main branch). They may contain bugs and are not recommended for compiling or running images.
### Overview
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.
**[Docker Hub](https://hub.docker.com/r/fly6516/multilang)**
- you can just use the prebuild images at multi-platform
- ```bash
docker pull fly6516/multilang
```
- you can use the pre-installed compilers and tools to compile and run your projects. The working directory is set to `/workspace`.
### Prerequisites
- Docker (with Buildx support if needed)
- Internet access to download dependencies
### Build Instructions
1. **Build the Docker image:**
Execute the following command in the project directory:
```bash
docker build -t multi-lang .
```
2. **Run the container:**
Start a container with:
```bash
docker run -it --rm multi-lang
```
### 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
```
---
[中文版本](#中文版本)
---
## 中文版本
<a id="中文版本"></a>
> ❗️ **警告** > 由于 latest 镜像(即 main 分支的优化slim 和 max 版本及其分支已被暂时搁置,可能存在 Bug不建议进行编译或运行镜像。
### 概述
该项目构建了一个基于 Docker 的多语言编译环境,支持 C/C++、Java、Python、Node.js、Go、Rust、Ruby、PHP、Haskell、Perl、Lua 以及 .NET 等多种语言的开发和编译。
**[Docker Hub](https://hub.docker.com/r/fly6516/multilang)**
- 您可以在多平台下使用预构建的镜像。
- ```bash
docker pull fly6516/multilang
```
- 您可以使用预先安装的编译器和工具来编译和运行您的项目。工作目录设置为 `/workspace`
### 前提条件
- 安装 Docker如果需要可支持 Buildx
- 具备下载依赖的网络环境
### 构建步骤
1. **构建 Docker 镜像:**
在项目目录下执行:
```bash
docker build -t multi-lang .
```
2. **运行容器:**
使用以下命令启动容器:
```bash
docker run -it --rm multi-lang
```
### 使用方法
进入容器后,所有的编译器与工具已经预先安装好,工作目录为 `/workspace`,可以直接在此目录下进行项目的开发和编译。
### 编译
#### 创建并启用 Buildx 构建器
```bash
docker buildx create --use
```
#### 启动 QEMU 支持的多架构模拟器
```bash
docker run --rm --privileged fly6516.synology.me:8080/multiarch/qemu-user-static --reset -p yes
```
#### 构建并推送多架构 Docker 镜像
```bash
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x,linux/mips64le -t fly6516/multilang:latest . --push
```
---
[English Version](#english-version)