# ======================= # CHORUS Development Images # ======================= # Multi-stage Dockerfile for language-specific development environments # Maintained by CHORUS Services (https://chorus.services) # ======================= # Base Image # ======================= ARG DEBIAN_VERSION=bookworm-20240408 FROM debian:${DEBIAN_VERSION} AS base # Metadata LABEL org.opencontainers.image.title="CHORUS Base Development Image" LABEL org.opencontainers.image.description="Base image for CHORUS autonomous agent development environments" LABEL org.opencontainers.image.vendor="CHORUS Services" LABEL org.opencontainers.image.source="https://gitea.chorus.services/tony/chorus-dev-images" LABEL org.opencontainers.image.documentation="https://gitea.chorus.services/tony/chorus-dev-images/src/branch/main/README.md" # Environment configuration ENV DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ LC_ALL=C.UTF-8 \ TZ=UTC \ WORKSPACE_ROOT=/workspace \ WORKSPACE_INPUT=/workspace/input \ WORKSPACE_DATA=/workspace/data \ WORKSPACE_OUTPUT=/workspace/output # Install base system packages RUN apt-get update && apt-get install -y --no-install-recommends \ # Core utilities ca-certificates \ curl \ wget \ git \ vim \ nano \ less \ jq \ # Build essentials build-essential \ pkg-config \ # Network tools netcat-traditional \ iputils-ping \ dnsutils \ # Process tools procps \ htop \ # Compression zip \ unzip \ tar \ gzip \ bzip2 \ xz-utils \ # SSL/TLS openssl \ # Version control git-lfs \ # Documentation man-db \ && rm -rf /var/lib/apt/lists/* # Create standardized workspace structure RUN mkdir -p \ ${WORKSPACE_INPUT} \ ${WORKSPACE_DATA} \ ${WORKSPACE_OUTPUT} \ && chmod -R 755 ${WORKSPACE_ROOT} # Create non-root user for development RUN useradd -m -s /bin/bash -u 1000 chorus && \ chown -R chorus:chorus ${WORKSPACE_ROOT} # Add workspace helper scripts COPY entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh WORKDIR ${WORKSPACE_DATA} USER chorus ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] CMD ["/bin/bash"] # ======================= # Rust Development Image # ======================= FROM base AS rust-dev USER root # Install Rust-specific system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ # Rust compilation dependencies libssl-dev \ libc6-dev \ # Database client libraries (common in Rust projects) libpq-dev \ libsqlite3-dev \ # Additional build tools cmake \ && rm -rf /var/lib/apt/lists/* USER chorus # Install Rust toolchain ENV RUSTUP_HOME=/home/chorus/.rustup \ CARGO_HOME=/home/chorus/.cargo \ PATH=/home/chorus/.cargo/bin:$PATH RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ --default-toolchain stable \ --profile default \ --no-modify-path # Install common Rust development tools RUN cargo install \ cargo-edit \ cargo-audit \ cargo-watch \ cargo-expand \ cargo-outdated \ ripgrep \ fd-find \ bat \ && rm -rf /home/chorus/.cargo/registry/cache # Configure Rust toolchain RUN rustup component add \ rustfmt \ clippy \ rust-analyzer LABEL org.opencontainers.image.title="CHORUS Rust Development Image" # ======================= # Go Development Image # ======================= FROM base AS go-dev USER root ARG GO_VERSION=1.22.2 # Install Go RUN wget -O go.tar.gz "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" && \ tar -C /usr/local -xzf go.tar.gz && \ rm go.tar.gz USER chorus ENV GOROOT=/usr/local/go \ GOPATH=/home/chorus/go \ PATH=/usr/local/go/bin:/home/chorus/go/bin:$PATH # Install common Go development tools RUN go install golang.org/x/tools/gopls@latest && \ go install github.com/go-delve/delve/cmd/dlv@latest && \ go install honnef.co/go/tools/cmd/staticcheck@latest && \ go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && \ go clean -cache -modcache LABEL org.opencontainers.image.title="CHORUS Go Development Image" # ======================= # Python Development Image # ======================= FROM base AS python-dev USER root # Install Python and development headers RUN apt-get update && apt-get install -y --no-install-recommends \ python3.11 \ python3.11-dev \ python3-pip \ python3-venv \ # Python build dependencies libffi-dev \ libssl-dev \ # Data science dependencies libxml2-dev \ libxslt1-dev \ && rm -rf /var/lib/apt/lists/* USER chorus # Install modern Python tooling ENV PATH=/home/chorus/.local/bin:$PATH RUN pip3 install --no-cache-dir --user \ # Package management uv \ pip-tools \ # Code quality ruff \ black \ mypy \ pylint \ # Testing pytest \ pytest-cov \ pytest-asyncio \ # Development tools ipython \ # Documentation sphinx \ mkdocs LABEL org.opencontainers.image.title="CHORUS Python Development Image" # ======================= # Node.js Development Image # ======================= FROM base AS node-dev USER root ARG NODE_VERSION=20 # Install Node.js from NodeSource RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ apt-get install -y --no-install-recommends nodejs && \ rm -rf /var/lib/apt/lists/* USER chorus # Install global development tools RUN npm install -g \ pnpm \ yarn \ typescript \ ts-node \ eslint \ prettier \ nodemon \ pm2 \ && npm cache clean --force LABEL org.opencontainers.image.title="CHORUS Node.js Development Image" # ======================= # Java Development Image # ======================= FROM base AS java-dev USER root # Install OpenJDK, Maven, and Gradle RUN apt-get update && apt-get install -y --no-install-recommends \ openjdk-17-jdk \ maven \ gradle \ && rm -rf /var/lib/apt/lists/* USER chorus ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 \ MAVEN_HOME=/usr/share/maven \ GRADLE_HOME=/usr/share/gradle \ PATH=/usr/lib/jvm/java-17-openjdk-amd64/bin:$PATH # Pre-create Maven local repository RUN mkdir -p /home/chorus/.m2 && \ echo '\n\ \n\ ' > /home/chorus/.m2/settings.xml LABEL org.opencontainers.image.title="CHORUS Java Development Image" # ======================= # C/C++ Development Image # ======================= FROM base AS cpp-dev USER root # Install C/C++ compilers and build systems RUN apt-get update && apt-get install -y --no-install-recommends \ # Compilers gcc \ g++ \ clang \ # Build systems cmake \ ninja-build \ autoconf \ automake \ libtool \ # Development libraries libboost-all-dev \ # Debugging tools gdb \ valgrind \ # Documentation doxygen \ && rm -rf /var/lib/apt/lists/* USER chorus LABEL org.opencontainers.image.title="CHORUS C/C++ Development Image"