commit 3f454b9805772d1cf42397476916ad36ad6b4098 Author: enoch Date: Sat May 3 14:58:45 2025 +0800 🎉 init: java, rust, latext dev containers diff --git a/java-container-dev-env/Containerfile b/java-container-dev-env/Containerfile new file mode 100644 index 0000000..3173044 --- /dev/null +++ b/java-container-dev-env/Containerfile @@ -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"] diff --git a/java-container-dev-env/compose.yaml b/java-container-dev-env/compose.yaml new file mode 100644 index 0000000..b7e7ecb --- /dev/null +++ b/java-container-dev-env/compose.yaml @@ -0,0 +1,19 @@ +version: '3' + +services: + maven-dev-env: + image: maven-java21-dev:3.9 + build: + context: . + dockerfile: Containerfile + container_name: maven-dev-env + restart: unless-stopped + ports: + - "9090:9090" + volumes: + - /workspace/projects/:/projects + - /workspace:/workspace + - /workspace/container-root-volumes/maven-dev-env-root:/root + # stdin_open: true # For -i + # tty: true # For -t + # detach mode is default in compose diff --git a/latex-workspace-container/Containerfile b/latex-workspace-container/Containerfile new file mode 100644 index 0000000..5aa3f00 --- /dev/null +++ b/latex-workspace-container/Containerfile @@ -0,0 +1,3 @@ +# Dockerfile示例 +FROM texlive/texlive:latest +RUN apt-get update && apt-get install -y git wget openssh-client netcat-openbsd bash-completion vim && apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/latex-workspace-container/compose.yaml b/latex-workspace-container/compose.yaml new file mode 100644 index 0000000..ea59d4e --- /dev/null +++ b/latex-workspace-container/compose.yaml @@ -0,0 +1,27 @@ +version: '3' + +services: + latex-workspace: + # image: texlive/texlive:latest + image: localhost/latex-env:v1 + build: + context: . + dockerfile: Containerfile + # image: localhost/latex-env:latest + container_name: latex-workspace + hostname: latex-env + volumes: + - /workspace/latex-projects:/workspace + - latex-root:/root + working_dir: /workspace + command: tail -f /dev/null # Keep the container running + environment: + - TERM=xterm-256color + restart: unless-stopped + ports: + - 8000:8000 + +volumes: + latex-root: + #latex-workspace: + diff --git a/rust-dev-env/Containerfile b/rust-dev-env/Containerfile new file mode 100644 index 0000000..31369e2 --- /dev/null +++ b/rust-dev-env/Containerfile @@ -0,0 +1,21 @@ +# 使用官方Rust镜像 +FROM rust:latest + +# 安装必要的系统依赖和工具 +RUN apt-get update && \ + apt-get install -y \ + build-essential \ + libssl-dev \ + pkg-config \ + git \ + vim \ + curl && \ + apt-get clean &&\ + rm -rf /var/lib/apt/lists/* + +# 配置工作目录 +#WORKDIR /app +WORKDIR /workspace +# 设置默认启动命令 +CMD ["bash"] + diff --git a/rust-dev-env/compose.yaml b/rust-dev-env/compose.yaml new file mode 100644 index 0000000..beabed5 --- /dev/null +++ b/rust-dev-env/compose.yaml @@ -0,0 +1,9 @@ +version: '3' +services: + rust-dev: + image: rust-dev + volumes: + - /workspace/projects:/workspace + working_dir: /workspace + tty: true + stdin_open: true