🎉 init: java, rust, latext dev containers
This commit is contained in:
12
java-container-dev-env/Containerfile
Normal file
12
java-container-dev-env/Containerfile
Normal 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"]
|
19
java-container-dev-env/compose.yaml
Normal file
19
java-container-dev-env/compose.yaml
Normal 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
|
Reference in New Issue
Block a user