# Core Languages Stack & Profiles The `core` image (`docker_core`) inherits from `base` and acts as a compiler/interpreter repository. It uses dynamic build arguments (`ARG_PROFILE_*`) to selectively install stack profiles. --- ## 1. Profile-Based Architecture Rather than maintaining separate Dockerfiles for each language, `core.Dockerfile` conditionally compiles stacks by evaluating comma-separated argument strings: - `ARG_PROFILE_NODEJS`: `base`, `bun`, `pnpm` - `ARG_PROFILE_JAVA`: `base`, `maven` - `ARG_PROFILE_LATEX`: `base`, `cjk` - `ARG_PROFILE_R`: `base`, `datascience`, `rstudio`, `rshiny` - `ARG_PROFILE_PYTHON`: `base`, `database`, `datascience`, `nlp`, `cv`, `bioinfo`, `tf2`, `torch` - `ARG_PROFILE_GO`: `base` - `ARG_PROFILE_JULIA`: `base` - `ARG_PROFILE_RUST`: `base` - `ARG_PROFILE_OCTAVE`: `base` --- ## 2. Language Installation Specs All compilers and environments are configured under `/opt/` and symlinked to `/usr/bin/` to maintain a clean system tree. ### Node.js Stack - **Node.js (`setup_node_base`)**: Fetches latest or requested version tarball from Node.js releases, moves to `/opt/node`, symlinks `node`/`npm`/`npx` to `/usr/bin/`, and updates global npm version. - **pnpm (`setup_node_pnpm`)**: Detects system architecture, pulls the corresponding standalone binary, sets up `/opt/node/pnpm-store` to keep package caches outside user workspace, and configures global profiles. - **Bun (`setup_node_bun`)**: Downloads Bun release zip, installs to `/opt/bun`, and symlinks to `/usr/bin/bun`. ### Java & Maven Stack - **JDK (`setup_java_base`)**: Installs Adoptium Temurin OpenJDK for version `<= 20`, or Oracle JDK for version `> 20` (handling alpine or Debian arm64/x64 variants automatically). Installs to `/opt/jdk` and links bin scripts. - **Maven (`setup_java_maven`)**: Downloads Maven release zip, installs to `/opt/maven`, and symlinks `/usr/bin/mvn`. ### Go Stack (`setup_GO`) Downloads standard `go` tarball, sets up `/opt/go`, and exports global `GOROOT`, `GOBIN`, and `GOPATH` in `/etc/profile.d/path-go.sh`. ### Rust Stack (`setup_rust`) Invokes standard rust installer script non-interactively. Overrides default directories: - `CARGO_HOME=/opt/cargo` - `RUSTUP_HOME=/opt/rust` Ensures all tools are globally accessible by adding `/opt/cargo/bin` to the system profile PATH. ### Julia Stack (`setup_julia`) Downloads Julia tarball to `/opt/julia`, links binary to `/usr/bin/julia`, and adds startup configuration file `/opt/julia/etc/julia/startup.jl` to: 1. Push `/opt/conda/lib` to dynamic load path (`Libdl.DL_LOAD_PATH`) to link Python shared libraries. 2. Force package registry storage to `/opt/julia/pkg` (`DEPOT_PATH[1]`). ### R Stack (`setup_R_base`) Adds CRAN repository key and index list. Installs R system libraries via apt, installs `devtools` package, and runs `R CMD javareconf` to bind system Java components. ### Octave Stack (`setup_octave`) Installs Octave via apt, parses dependencies, and installs user-specified Octave packages from forge repository. ### LaTeX Stack Installs standard TeX Live packages (`install_list_latex_base.apt`) and extra CJK fonts/packages (`install_list_latex_cjk.apt`) conditionally based on build profiles.