From a29823aa40906da7180a924320541b792c93048d Mon Sep 17 00:00:00 2001 From: Ihor Dvoretskyi Date: Sun, 22 Mar 2026 11:31:27 +0100 Subject: [PATCH 1/4] Refactor Dockerfile to remove package upgrade during build and update README for clarity and structure Signed-off-by: Ihor Dvoretskyi --- .devcontainer/Dockerfile | 1 - LICENSE | 2 +- README.md | 63 +++++++++++++++++++++++++--------------- 3 files changed, 41 insertions(+), 25 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 62dab21..fb89a19 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,7 +2,6 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 # hadolint ignore=DL3008 RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y upgrade --no-install-recommends \ && apt-get -y install --no-install-recommends \ curl \ wget \ diff --git a/LICENSE b/LICENSE index 2373f58..f8cd3df 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Ihor Dvoretskyi +Copyright (c) 2026 Ihor Dvoretskyi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 02054d6..f7a93cb 100644 --- a/README.md +++ b/README.md @@ -3,59 +3,73 @@ [![CI](https://github.com/idvoretskyi/dev/actions/workflows/ci.yml/badge.svg)](https://github.com/idvoretskyi/dev/actions/workflows/ci.yml) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/idvoretskyi/dev) -This repository serves as an optimized GitHub Codespaces template for general development workflows. +This repository provides a lean development container template for GitHub +Codespaces and local VS Code Dev Containers. ## Features -- Base image: Ubuntu 24.04 -- Essential development tools: - - Python 3.12 with pip - - Node.js LTS with npm - - Git (OS-provided) +- Ubuntu 24.04 base image +- Single-image devcontainer build based on `.devcontainer/Dockerfile` +- Core tooling for general development work: + - Python 3 with `venv` and `pip` + - Node.js LTS with `npm` - Docker-in-Docker with Docker Compose v2 - GitHub CLI - - Claude Code CLI - - Zsh with common utilities - - Build essentials (gcc, make, etc.) + - Claude Code CLI installed in `postCreateCommand` + - Zsh and common shell utilities + - Build essentials (`gcc`, `make`, and related packages) + - SSH daemon support via the devcontainer feature - VS Code extensions: - - Claude Dev (Anthropic) - - Python language support - - Docker support - - GitHub Copilot - - YAML support + - Anthropic Claude Code + - Python and Pylance + - Docker + - GitHub Copilot and Copilot Chat + - YAML ## Performance Optimizations The devcontainer balances speed with operability: -- Includes essential tools: Python, Node.js, Docker, Git, GitHub CLI, Claude Code CLI -- Disabled package upgrades during build -- Removed heavy features (kubectl, helm, minikube, sshd) -- Uses OS-provided Git for faster builds -- Uses OS-provided Python (precompiled) for faster setup -- Installs Claude Code CLI via npm in postCreateCommand -- Core VS Code extensions only +- Keeps the image focused on core development tooling +- Avoids full package upgrades during image build to reduce rebuild time +- Uses the devcontainer feature set for Node.js, Git, Docker, GitHub CLI, and SSH +- Uses Ubuntu's packaged Python runtime for a faster base setup +- Installs Claude Code CLI in `postCreateCommand` instead of baking it into the image +- Limits editor customizations to a small, broadly useful extension set -Estimated startup time: 2-3 minutes +Estimated startup time: 2-3 minutes, depending on feature downloads and +network speed. ## Usage ### GitHub Codespaces + 1. Click "Code" button on the GitHub repository 2. Select "Create codespace on main" 3. Wait for the environment to build ### VS Code Local Dev Containers + 1. Clone this repository 2. Open in VS Code 3. Click "Reopen in Container" when prompted +## Repository Structure + +- `.devcontainer/devcontainer.json`: main devcontainer definition, features, + VS Code extensions, and post-create validation command +- `.devcontainer/Dockerfile`: minimal image customization for extra packages +- `.github/workflows/ci.yml`: CI checks for Dockerfile linting, secret + scanning, image build, and devcontainer smoke testing + ## Using as a Template ### Method 1: GitHub Template + Click "Use this template" button to create a new repository ### Method 2: Copy Configuration + ```bash cp -r .devcontainer /path/to/your/project/ ``` @@ -75,7 +89,7 @@ Edit `.devcontainer/devcontainer.json` to add features or tools: } ``` -To add heavy tools like Kubernetes: +To add heavier tooling when you actually need it: ```json { @@ -89,6 +103,9 @@ To add heavy tools like Kubernetes: } ``` +If you add new features or packages, keep the CI workflow in sync with any new +tooling expectations you want validated during the container smoke test. + ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. From cb62c2bdab07bed0f1d022e5cc7e52c17bd4f9ec Mon Sep 17 00:00:00 2001 From: Ihor Dvoretskyi Date: Sun, 22 Mar 2026 11:31:47 +0100 Subject: [PATCH 2/4] Reformat Dockerfile for improved readability of package installation Signed-off-by: Ihor Dvoretskyi --- .devcontainer/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index fb89a19..c43d9d5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,13 +3,13 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 # hadolint ignore=DL3008 RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends \ - curl \ - wget \ - jq \ - build-essential \ - python3 \ - python3-venv \ - python3-pip \ + curl \ + wget \ + jq \ + build-essential \ + python3 \ + python3-venv \ + python3-pip \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* From b3fba1f9eca00532b339e509a6af51aece3809f8 Mon Sep 17 00:00:00 2001 From: Ihor Dvoretskyi Date: Sun, 22 Mar 2026 11:33:03 +0100 Subject: [PATCH 3/4] Add newline for improved readability in README.md Signed-off-by: Ihor Dvoretskyi --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f7a93cb..bf59197 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Development Environment Repository [![CI](https://github.com/idvoretskyi/dev/actions/workflows/ci.yml/badge.svg)](https://github.com/idvoretskyi/dev/actions/workflows/ci.yml) + [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/idvoretskyi/dev) This repository provides a lean development container template for GitHub From c820170fe4351eb55e9ff42044014d65eeb2b190 Mon Sep 17 00:00:00 2001 From: Ihor Dvoretskyi Date: Sun, 22 Mar 2026 11:35:54 +0100 Subject: [PATCH 4/4] Update .devcontainer/Dockerfile Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ihor Dvoretskyi --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c43d9d5..6a477d5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ python3 \ python3-venv \ python3-pip \ - && apt-get clean -y \ + && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /home/vscode/.ssh \