🎉 init: java, rust, latext dev containers

This commit is contained in:
enoch 2025-05-03 14:58:45 +08:00
commit 3f454b9805
6 changed files with 91 additions and 0 deletions

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"]

View File

@ -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

View File

@ -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/*

View File

@ -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:

View File

@ -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"]

View File

@ -0,0 +1,9 @@
version: '3'
services:
rust-dev:
image: rust-dev
volumes:
- /workspace/projects:/workspace
working_dir: /workspace
tty: true
stdin_open: true