diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 62dab21..6a477d5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,16 +2,15 @@ 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 \ - jq \ - build-essential \ - python3 \ - python3-venv \ - python3-pip \ - && apt-get clean -y \ + curl \ + wget \ + jq \ + build-essential \ + python3 \ + python3-venv \ + python3-pip \ + && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /home/vscode/.ssh \ 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..bf59197 100644 --- a/README.md +++ b/README.md @@ -1,61 +1,76 @@ # 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 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 +90,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 +104,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.