添加多个开发环境的 Docker 配置,包括 Debian、Maven、LaTeX 和 Rust,移除旧的 Rust 配置

This commit is contained in:
2025-05-03 15:29:58 +08:00
parent 3f454b9805
commit aca5f52bc2
11 changed files with 101 additions and 19 deletions

12
java-maven/Containerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM maven:3.9-eclipse-temurin-21
# 安装基础工具
RUN sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/ubuntu.sources && sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources && sed -i 's/http:/https:/g' /etc/apt/sources.list.d/ubuntu.sources
RUN apt-get update && \
apt-get install -y git curl vim ripgrep unzip netcat-openbsd && \
# 清理缓存
rm -rf /var/lib/apt/lists/*
# 设置工作目录
WORKDIR /workspace
# 防止容器关闭
CMD ["tail", "-f", "/dev/null"]

15
java-maven/compose.yaml Normal file
View File

@@ -0,0 +1,15 @@
services:
maven-dev-env:
image: maven-java21-dev:3.9
build:
context: .
dockerfile: Containerfile
container_name: maven-devcontainer
hostname: maven-devcontainer
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- /workspace/projects/:/projects
- /workspace:/workspace
- /workspace/devcontainer-vols/maven-devcontainer-root:/root