From fe5970c93c5cca88340d436e545f97e78ce4666a Mon Sep 17 00:00:00 2001 From: JP White Date: Thu, 19 Jun 2025 18:04:22 -0400 Subject: [PATCH 1/5] Update Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4fc9cb1..8717982 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,13 +64,13 @@ RUN \ # GO installation RUN \ - curl -OL https://go.dev/dl/go1.22.3.linux-amd64.tar.gz \ - && tar -C /usr/local -xvf go1.22.3.linux-amd64.tar.gz \ + curl -OL https://go.dev/dl/go1.24.4.linux-amd64.tar.gz \ + && tar -C /usr/local -xvf go1.24.4.linux-amd64.tar.gz \ && ln -s /usr/local/go/bin/go /usr/bin/go # Node installation with nvm ENV NODE_VERSION lts/iron -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \ +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash \ && . ~/.nvm/nvm.sh \ && nvm install $NODE_VERSION \ && nvm alias default $NODE_VERSION \ From 0db1ccc9be63d89444343729b71f8bcf5b4cc470 Mon Sep 17 00:00:00 2001 From: JP White Date: Thu, 19 Jun 2025 18:10:25 -0400 Subject: [PATCH 2/5] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8717982..4bf146f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:mantic +FROM ubuntu:latest SHELL ["/bin/bash", "-c"] From 2624c58a0302fa0582538a4fd5c18efdf3845ad7 Mon Sep 17 00:00:00 2001 From: JP White Date: Sat, 21 Jun 2025 13:22:54 -0400 Subject: [PATCH 3/5] Updating tools to latest version --- Dockerfile | 6 +++--- README.md | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4bf146f..413e1c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,9 +31,9 @@ RUN apt update \ # PYTHON LATEST python3 python3-dev python3-venv python3-pip \ # JAVA LATEST - openjdk-20-jdk-headless \ + openjdk-21-jdk \ # .NET-CORE LATEST - dotnet6 \ + dotnet-sdk-8.0 dotnet-runtime-8.0 \ # Ruby LATEST ruby-full rbenv \ # CLEAN UP @@ -60,7 +60,7 @@ RUN \ # Python configuration RUN \ ln -s /usr/bin/python3 /usr/bin/python \ - && python -m pip install --upgrade pip setuptools wheel poetry pipenv --break-system-packages + && python -m pip install pipx poetry pipenv --break-system-packages # GO installation RUN \ diff --git a/README.md b/README.md index 42b549a..af48ce5 100644 --- a/README.md +++ b/README.md @@ -10,24 +10,24 @@ Multi programming language container image built for interactive development env - [GitLab](https://about.gitlab.com) - etc. -_NOTE:_ This image is on the large side, around 2.5GB in total. This makes it too big for most large scale uses. But in small scale it seems to work quite well despite its size. +_NOTE:_ This image is **large**, around 5GB in total. This makes it far too big for most large scale uses. But in small scale it seems to work quite well despite its size. ## Base Image -This image is based on Ubuntu 23.10 (mantic) +This image is based on Ubuntu (latest LTS) ## Included Languages & Tools -| Language Ecosystem | Version | Included Tools | -| ------------------ | -------- | -------------- | -| Node | 20.10.0 | nvm, npm | -| Python | 3.11.5 | Poetry, pipenv | -| Ruby | 3.1.2p20 | gem, rbenv | -| Java | 20.0.2 | | -| Dotnet | 6.0.122 | | -| GO | 1.21.5 | | -| Rust | 1.74.1 | | -| Docker | 24.0.7 | | +| Language Ecosystem | Version | Included Tools | +| ------------------ | -------- | -------------------- | +| Node | 20.10.0 | nvm, npm | +| Python | 3.11.5 | poetry, pipenv, pipx | +| Ruby | 3.1.2p20 | gem, rbenv | +| Java | 21.0.7 | | +| Dotnet | 8.0.117 | | +| GO | 1.24.4 | | +| Rust | 1.87.0 | | +| Docker | 28.2.2 | | # Build Instructions From 74cf03044ef70ff8e431a89d749c7511505dd9e5 Mon Sep 17 00:00:00 2001 From: JP White Date: Sat, 21 Jun 2025 15:08:13 -0400 Subject: [PATCH 4/5] Updated tools to latest --- Dockerfile | 197 +++++++++++++++++++++++++++++------------------------ Makefile | 3 + README.md | 20 +++--- 3 files changed, 121 insertions(+), 99 deletions(-) diff --git a/Dockerfile b/Dockerfile index 413e1c0..4278d42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,106 +1,125 @@ -FROM ubuntu:latest +# Stage 1: Base system with common dependencies +FROM ubuntu:24.04 AS base SHELL ["/bin/bash", "-c"] +ENV TZ='America/New_York' \ + DEBIAN_FRONTEND="noninteractive" \ + PATH="/root/.cargo/bin:/root/.nvm/versions/node/v22.16.0/bin:/usr/local/go/bin:${PATH}" \ + NVM_DIR="/root/.nvm" \ + NODE_VERSION="lts/jod" -ENV TZ='America/New_York' -RUN apt update \ - && apt upgrade -y \ - && apt install software-properties-common -y \ - && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \ - curl \ - wget \ - sudo \ - apt-utils \ +# Install common packages in a single layer with proper cleanup +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y --no-install-recommends \ apt-transport-https \ + apt-utils \ + ca-certificates \ + curl \ g++ \ gcc \ git \ + gpg \ + gpg-agent \ + jq \ + less \ + # libc6-dev \ make \ - p7zip-full \ + software-properties-common \ + sudo \ + tree \ unzip \ - xz-utils \ - jq \ + zip \ vim \ - tree \ - less \ - libc6-dev \ - dirmngr \ - gpg gpg-agent \ - ca-certificates \ - zsh \ - # PYTHON LATEST - python3 python3-dev python3-venv python3-pip \ - # JAVA LATEST - openjdk-21-jdk \ - # .NET-CORE LATEST - dotnet-sdk-8.0 dotnet-runtime-8.0 \ - # Ruby LATEST - ruby-full rbenv \ - # CLEAN UP - && apt-get purge --auto-remove -y \ - && apt-get clean \ - && rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* + wget \ + # xz-utils \ + zsh && \ + # Clean up in the same layer to reduce image size + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -# Zshell Configuration -RUN chsh -s $(which zsh) -RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended -COPY polyglot.zsh-theme /root/.oh-my-zsh/themes/polyglot.zsh-theme -RUN sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="polyglot"/' /root/.zshrc +# Stage 2: Language-specific installations +FROM base AS languages -# Git Configuration -RUN \ - git config --global pull.rebase true \ - && git config --global init.defaultbranch main \ - && git config --global fetch.prune true \ - && git config --global diff.colorMoved zebra - -# Python configuration -RUN \ - ln -s /usr/bin/python3 /usr/bin/python \ - && python -m pip install pipx poetry pipenv --break-system-packages - -# GO installation -RUN \ - curl -OL https://go.dev/dl/go1.24.4.linux-amd64.tar.gz \ - && tar -C /usr/local -xvf go1.24.4.linux-amd64.tar.gz \ - && ln -s /usr/local/go/bin/go /usr/bin/go - -# Node installation with nvm -ENV NODE_VERSION lts/iron -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash \ - && . ~/.nvm/nvm.sh \ - && nvm install $NODE_VERSION \ - && nvm alias default $NODE_VERSION \ - && nvm use default \ - && ln -s $(which node) /usr/bin/node \ - && ln -s $(which npm) /usr/bin/npm - -# Rust installation +# Add repositories and install programming languages in a single layer +RUN apt-get update && \ + # Python + apt-get install -y --no-install-recommends python3 python3-dev python3-venv python3-pip && \ + ln -s /usr/bin/python3 /usr/bin/python && \ + # Java + apt-get install -y --no-install-recommends openjdk-21-jdk && \ + # .NET + apt-get install -y --no-install-recommends dotnet-sdk-8.0 dotnet-runtime-8.0 && \ + # Ruby + apt-get install -y --no-install-recommends ruby-full rbenv && \ + # Clean up + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Stage 3: Tool installations (Go, Node, Rust, Docker) +FROM languages AS tools + +# Install Go +RUN curl -OL https://go.dev/dl/go1.24.4.linux-amd64.tar.gz && \ + tar -C /usr/local -xf go1.24.4.linux-amd64.tar.gz && \ + rm go1.24.4.linux-amd64.tar.gz && \ + ln -sf /usr/local/go/bin/go /usr/bin/go + +# Install Node.js with nvm +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash && \ + . $NVM_DIR/nvm.sh && \ + nvm install $NODE_VERSION && \ + nvm alias default $NODE_VERSION && \ + nvm use default && \ + ln -sf $(. $NVM_DIR/nvm.sh && which node) /usr/bin/node && \ + ln -sf $(. $NVM_DIR/nvm.sh && which npm) /usr/bin/npm + +# Install Rust RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" -# Docker installation +# Install Docker RUN curl -fsSL https://get.docker.com | sh -# Print versions -RUN \ - echo "Tool versions:" \ - && python --version \ - && pip --version \ - && poetry --version \ - && pipenv --version \ - && java -version \ - && go version \ - && dotnet --version \ - && node --version \ - && npm --version \ - && rustup --version \ - && rustc --version \ - && ruby --version \ - && gem --version \ - && rbenv --version \ - && docker --version +# Stage 4: Python packages and configuration +FROM tools AS python-config + +RUN python -m pip install --no-cache-dir pipx poetry pipenv --break-system-packages + +# Stage 5: Final image with configurations +FROM python-config AS final + +# Git Configuration +RUN git config --global pull.rebase true && \ + git config --global init.defaultbranch main && \ + git config --global fetch.prune true && \ + git config --global diff.colorMoved zebra + +# Zshell Configuration +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended && \ + chsh -s $(which zsh) + +# Copy theme file +COPY polyglot.zsh-theme /root/.oh-my-zsh/themes/polyglot.zsh-theme +RUN sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="polyglot"/' /root/.zshrc + +# Print versions for verification +RUN echo "Tool versions:" && \ + python --version && \ + pip --version && \ + poetry --version && \ + pipenv --version && \ + java -version && \ + go version && \ + dotnet --version && \ + . $NVM_DIR/nvm.sh && \ + node --version && \ + npm --version && \ + rustup --version && \ + rustc --version && \ + ruby --version && \ + gem --version && \ + rbenv --version && \ + docker --version +# Set default shell to zsh +CMD ["zsh"] diff --git a/Makefile b/Makefile index 09b9d58..e046e8f 100644 --- a/Makefile +++ b/Makefile @@ -14,5 +14,8 @@ shell: build: docker build . -t jpwhite3/polyglot:latest --platform linux/amd64 --progress=plain +scan: + docker scout quickview + publish: docker push jpwhite3/polyglot:latest diff --git a/README.md b/README.md index af48ce5..8841a7e 100644 --- a/README.md +++ b/README.md @@ -18,16 +18,16 @@ This image is based on Ubuntu (latest LTS) ## Included Languages & Tools -| Language Ecosystem | Version | Included Tools | -| ------------------ | -------- | -------------------- | -| Node | 20.10.0 | nvm, npm | -| Python | 3.11.5 | poetry, pipenv, pipx | -| Ruby | 3.1.2p20 | gem, rbenv | -| Java | 21.0.7 | | -| Dotnet | 8.0.117 | | -| GO | 1.24.4 | | -| Rust | 1.87.0 | | -| Docker | 28.2.2 | | +| Language Ecosystem | Version | Included Tools | +| ------------------ | ------- | -------------------- | +| Node | 22.16.0 | nvm, npm | +| Python | 3.11.5 | poetry, pipenv, pipx | +| Java | 21.0.7 | | +| Dotnet | 8.0.117 | | +| GO | 1.24.4 | | +| Ruby | 3.2.3 | rbenv, gem | +| Rust | 1.87.0 | | +| Docker | 28.2.2 | | # Build Instructions From 82cdc2af2b32e576fec32657e523a81da3c700d5 Mon Sep 17 00:00:00 2001 From: JP White Date: Sat, 21 Jun 2025 15:45:54 -0400 Subject: [PATCH 5/5] Update readme after build --- Makefile | 23 +++++++++++++++++++++++ README.md | 20 ++++++++++---------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index e046e8f..d5fb5a9 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,29 @@ shell: build: docker build . -t jpwhite3/polyglot:latest --platform linux/amd64 --progress=plain + @echo "Updating README.md with latest tool versions..." + @container_id=$$(docker run -d jpwhite3/polyglot:latest sleep 30) && \ + node_version=$$(docker exec $$container_id bash -c '. /root/.nvm/nvm.sh && node --version' | tr -d 'v') && \ + python_version=$$(docker exec $$container_id python --version | awk '{print $$2}') && \ + java_version=$$(docker exec $$container_id bash -c "java -version 2>&1 | head -1" | awk -F '"' '{print $$2}') && \ + dotnet_version=$$(docker exec $$container_id dotnet --version) && \ + go_version=$$(docker exec $$container_id go version | awk '{print $$3}' | sed 's/go//') && \ + ruby_version=$$(docker exec $$container_id ruby --version | awk '{print $$2}') && \ + rust_version=$$(docker exec $$container_id rustc --version | awk '{print $$2}') && \ + docker_version=$$(docker exec $$container_id docker --version | awk '{print $$3}' | tr -d ',') && \ + docker rm -f $$container_id > /dev/null 2>&1 && \ + sed -i.bak \ + -e "s/| Node |.*|/| Node | $$node_version |/" \ + -e "s/| Python |.*|/| Python | $$python_version |/" \ + -e "s/| Java |.*|/| Java | $$java_version |/" \ + -e "s/| Dotnet |.*|/| Dotnet | $$dotnet_version |/" \ + -e "s/| GO |.*|/| GO | $$go_version |/" \ + -e "s/| Ruby |.*|/| Ruby | $$ruby_version |/" \ + -e "s/| Rust |.*|/| Rust | $$rust_version |/" \ + -e "s/| Docker |.*|/| Docker | $$docker_version |/" \ + README.md && \ + rm README.md.bak && \ + echo "README.md updated with latest tool versions" scan: docker scout quickview diff --git a/README.md b/README.md index 8841a7e..b53dc5f 100644 --- a/README.md +++ b/README.md @@ -18,16 +18,16 @@ This image is based on Ubuntu (latest LTS) ## Included Languages & Tools -| Language Ecosystem | Version | Included Tools | -| ------------------ | ------- | -------------------- | -| Node | 22.16.0 | nvm, npm | -| Python | 3.11.5 | poetry, pipenv, pipx | -| Java | 21.0.7 | | -| Dotnet | 8.0.117 | | -| GO | 1.24.4 | | -| Ruby | 3.2.3 | rbenv, gem | -| Rust | 1.87.0 | | -| Docker | 28.2.2 | | +| Language Ecosystem | Version | +| ------------------ | ------- | +| Node | 22.16.0 | +| Python | 3.12.3 | +| Java | 21.0.7 | +| Dotnet | 8.0.117 | +| GO | 1.24.4 | +| Ruby | 3.2.3 | +| Rust | 1.87.0 | +| Docker | 28.2.2 | # Build Instructions