{"id":24041865,"url":"https://github.com/containercraft/devcontainer","last_synced_at":"2025-04-19T19:52:27.618Z","repository":{"id":114566184,"uuid":"529466503","full_name":"ContainerCraft/devcontainer","owner":"ContainerCraft","description":"Cloud Dev \u0026 Ops Devcontainer","archived":false,"fork":false,"pushed_at":"2025-04-06T16:10:07.000Z","size":2575,"stargazers_count":40,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T16:07:52.237Z","etag":null,"topics":["cloud","codespaces","containers","devcontainer","devops","github","gitops","iac","kubernetes","pulumi","vscode"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ContainerCraft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-27T03:04:51.000Z","updated_at":"2025-04-06T16:10:10.000Z","dependencies_parsed_at":"2023-12-10T01:33:34.350Z","dependency_job_id":"7c4db7d0-ab4a-4d5a-a293-8aa15325b69f","html_url":"https://github.com/ContainerCraft/devcontainer","commit_stats":null,"previous_names":["containercraft/konductor-container"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fdevcontainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fdevcontainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fdevcontainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fdevcontainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ContainerCraft","download_url":"https://codeload.github.com/ContainerCraft/devcontainer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249786202,"owners_count":21325562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","codespaces","containers","devcontainer","devops","github","gitops","iac","kubernetes","pulumi","vscode"],"created_at":"2025-01-08T22:13:32.389Z","updated_at":"2025-04-19T19:52:27.597Z","avatar_url":"https://github.com/ContainerCraft.png","language":"Dockerfile","readme":"# ContainerCraft Devcontainer\n\n[![Build Status](https://github.com/containercraft/devcontainer/actions/workflows/build.yaml/badge.svg)](https://github.com/containercraft/devcontainer/actions/workflows/build.yaml)\n\nA comprehensive cloud-native development container with built-in support for Pulumi, Kubernetes, and modern development workflows. Pre-configured with essential tools and optimized for cloud infrastructure development.\n\n## Table of Contents\n\n- [Features](#features)\n- [Image Variants](#image-variants)\n  - [Supported Architectures](#supported-architectures)\n- [Development Modes](#development-modes)\n  - [VSCode / Cursor AI Development Container](#vscode--cursor-ai-development-container)\n  - [Neovim Development Environment](#neovim-development-environment)\n  - [Remote Code-Server](#remote-code-server)\n  - [Terminal-Based Development](#terminal-based-development)\n  - [Local Docker Desktop / Docker CLI (on Linux)](#local-docker-desktop--docker-cli-on-linux)\n  - [Remote GitHub Codespaces via Remote Containers Extension](#remote-github-codespaces-via-remote-containers-extension)\n- [Installed Tools](#installed-tools)\n  - [Programming Languages](#programming-languages)\n  - [Core Utilities](#core-utilities)\n  - [Development Tools](#development-tools)\n  - [Cloud Native Tools](#cloud-native-tools)\n- [Configuration and Environment](#configuration-and-environment)\n  - [Environment Variables](#environment-variables)\n  - [User and Permission Model](#user-and-permission-model)\n  - [Volume Mounts and Ports](#volume-mounts-and-ports)\n  - [Shell Customizations](#shell-customizations)\n- [Usage](#usage)\n  - [Quick Start Guides](#quick-start-guides)\n    - [Running the Slim Variant](#running-the-slim-variant)\n    - [Accessing Neovim](#accessing-neovim)\n    - [Using Docker-in-Docker](#using-docker-in-docker)\n  - [Volume and Network Configuration](#volume-and-network-configuration)\n- [Technical Specifications](#technical-specifications)\n  - [Container Configuration](#container-configuration)\n  - [Tool Chain Details](#tool-chain-details)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## Features\n\n- 🏗️ **Multi-architecture support**: Compatible with both `amd64` and `arm64` architectures.\n- 🐳 **Docker-in-Docker capabilities**: Enables running Docker inside the container for testing and development.\n- 🔧 **Multiple development modes**: Supports VSCode, Neovim, and Code-Server for diverse workflows.\n- 🛠️ **Comprehensive cloud-native CLI tools**: Includes Kubernetes tools, Pulumi, Helm, and more.\n- 🐍 **Multiple language support**: Python, Node.js, Go, and .NET environments pre-configured.\n- 🔐 **Security-focused configuration**: User and permission models optimized for secure development.\n- 🎨 **Custom shell with Starship prompt**: Enhanced terminal experience with Starship and tmux.\n- 🖥️ **Remote development ready**: Optimized for Codespaces and remote container development.\n\n## Image Variants\n\nThe ContainerCraft Devcontainer provides multiple Docker image variants tailored for different development needs. Below is a summary of the available images, their inheritance chain, and key features.\n\n| Tag           | Base Image                                     | Description                        | Key Features                      |\n|---------------|------------------------------------------------|------------------------------------|-----------------------------------|\n| `slim`        | `mcr.microsoft.com/devcontainers/base:ubuntu`  | Minimal base environment           | Core dev tools, Pulumi CLI        |\n| `slim-python` | `ghcr.io/containercraft/devcontainer:slim`     | Python development environment     | Python 3.x, Poetry                |\n| `slim-node`   | `ghcr.io/containercraft/devcontainer:slim`     | Node.js development environment    | Node.js 20.x, npm, yarn           |\n| `slim-golang` | `ghcr.io/containercraft/devcontainer:slim`     | Go development environment         | Go 1.x                            |\n| `slim-dotnet` | `ghcr.io/containercraft/devcontainer:slim`     | .NET development environment       | .NET SDK 7.0                      |\n| `slim-all`    | `ghcr.io/containercraft/devcontainer:slim`     | All language support               | Python, Go, Node.js, .NET         |\n| `dind`        | `ghcr.io/containercraft/devcontainer:slim`     | Docker-in-Docker capabilities      | Docker CLI, Docker Buildx         |\n| `base`        | `ghcr.io/containercraft/devcontainer:slim-all` | Kubernetes-focused tools           | kubectl, k9s, Helm, Krew plugins  |\n| `nvim`        | `ghcr.io/containercraft/devcontainer:dind`     | Neovim development environment     | Neovim with LazyVim configuration |\n| `extra`       | `ghcr.io/containercraft/devcontainer:nvim`     | Extended tools                     | Additional CLIs                   |\n| `code`        | `ghcr.io/containercraft/devcontainer:extra`    | VSCode Server in browser           | code-server with browser access   |\n\n### Supported Architectures\n\nAll images support the following architectures:\n\n- `amd64` (x86_64)\n- `arm64` (aarch64)\n\n## Development Modes\n\n### VSCode / Cursor AI Development Container\n\nLeverage the development container with [Visual Studio Code](https://code.visualstudio.com/) or [Cursor AI](https://cursor.dev/) for a seamless development experience.\n\nAdd the following `.devcontainer/Dockerfile` to your project:\n\n```Dockerfile\nFROM ghcr.io/containercraft/devcontainer:latest\n\n# Install additional tools or dependencies\n# ...\n```\n\nAdd the following `devcontainer.json` configuration to your project:\n\n```json\n{\n  \"name\": \"ContainerCraft Devcontainer\",\n  \"dockerFile\": \"Dockerfile\",\n  \"settings\": {\n    \"terminal.integrated.defaultProfile.linux\": \"bash\"\n  },\n  \"extensions\": [\n    \"ms-azuretools.vscode-docker\",\n    \"ms-python.python\",\n    \"golang.go\"\n  ],\n  \"remoteUser\": \"vscode\",\n  \"postCreateCommand\": \"devcontainer-links\",\n  \"forwardPorts\": [8080, 1313],\n  \"mounts\": [\n    \"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind\"\n  ],\n  \"runArgs\": [\n    \"--init\",\n    \"--privileged\"\n  ]\n}\n```\n\nClone your repository:\n\n```bash\ngit clone https://github.com/your/repo.git\n```\n\n- **Requirements**:\n  - [VSCode](https://code.visualstudio.com/) or [Cursor AI](https://cursor.dev/)\n  - [Docker Desktop](https://www.docker.com/products/docker-desktop) or Docker CLI\n\n### Neovim Development Environment\n\nUse the Neovim-configured container for terminal-based development with advanced editing capabilities.\n\n```bash\ndocker run -it --rm \\\n  --name neovim \\\n  --hostname neovim \\\n  --entrypoint bash \\\n  --workdir /workspace/project \\\n  -v \"$(pwd):/workspace/project\" \\\n  ghcr.io/containercraft/devcontainer:nvim\n```\n\n- **Features**:\n  - Pre-configured Neovim with LazyVim setup.\n  - LSP support for multiple languages.\n  - Tmux integration for multiplexing.\n\n### Remote Code-Server\n\nRun VSCode in the browser using code-server for remote development.\n\n```bash\ndocker run --rm -d \\\n  --name codeserver \\\n  --hostname codeserver \\\n  -p 8080:8080 \\\n  ghcr.io/containercraft/devcontainer:code\n```\n\n- **Access**: Open your browser and navigate to `http://localhost:8080`.\n- **Features**:\n  - Full VSCode experience in the browser.\n  - Extensions pre-installed for cloud-native development.\n\n### Terminal-Based Development\n\nAccess a fully-featured terminal environment with all tools installed, ideal for SSH or TTYD access.\n\n```bash\ndocker run -it --rm \\\n  --name terminal \\\n  --hostname terminal \\\n  --entrypoint bash \\\n  ghcr.io/containercraft/devcontainer:slim\n```\n\n- **Features**:\n  - Starship prompt with custom theme.\n  - Tmux session management.\n  - Shell utilities and aliases pre-configured.\n\n### Local Docker Desktop / Docker CLI (on Linux)\n\nUse the `dind` variant to run Docker-in-Docker for local development on Linux systems.\n\n```bash\ndocker run --privileged --rm -d \\\n  --name dind \\\n  --hostname dind \\\n  ghcr.io/containercraft/devcontainer:dind\n```\n\n- **Features**:\n  - Docker CLI and Buildx installed.\n  - Ability to build and run Docker images within the container.\n\n### Remote GitHub Codespaces via Remote Containers Extension\n\nThe images are compatible with GitHub Codespaces for remote development using the Remote Containers extension.\n\n- **Requirements**:\n  - [GitHub Codespaces](https://github.com/features/codespaces)\n  - [Remote - Containers Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)\n\n## Installed Tools\n\n### Programming Languages\n\n#### Python\n\n- **Versions**: 3.x, 3.11\n- **Tools**:\n  - `pip`: Package installer.\n  - `Poetry`: Dependency management and packaging.\n  - `setuptools`: Library for building and distributing Python packages.\n\n#### Node.js\n\n- **Version**: 20.x\n- **Tools**:\n  - `npm`: Node package manager.\n  - `yarn`: Alternative package manager.\n\n#### Go\n\n- **Version**: Latest stable (1.x)\n- **Description**: Open-source programming language that makes it easy to build simple, reliable, and efficient software.\n\n#### .NET\n\n- **Version**: SDK 7.0\n- **Description**: Free, cross-platform, open-source developer platform for building many different types of applications.\n\n### Core Utilities\n\n| Tool Name  | Version | Description                                | Link                                     |\n|------------|---------|--------------------------------------------|------------------------------------------|\n| `git`      | Latest  | Distributed version control system         | [Git](https://git-scm.com/)              |\n| `gh`       | Latest  | GitHub CLI for interacting with GitHub     | [GitHub CLI](https://cli.github.com/)    |\n| `jq`       | Latest  | Command-line JSON processor                | [jq](https://stedolan.github.io/jq/)     |\n| `direnv`   | Latest  | Environment variable management            | [Direnv](https://direnv.net/)            |\n| `starship` | Latest  | Fast, customizable shell prompt            | [Starship](https://starship.rs/)         |\n| `tmux`     | Latest  | Terminal multiplexer                       | [tmux](https://github.com/tmux/tmux)     |\n| `nix`      | Latest  | Package manager and build system           | [Nix](https://nixos.org/)                |\n| `runme`    | Latest  | Execute commands directly from README.md   | [Runme](https://runme.dev/)              |\n| `task`     | Latest  | Task runner and build tool                 | [Task](https://taskfile.dev/)            |\n| `lazygit`  | Latest  | Simple terminal UI for git commands        | [lazygit](https://github.com/jesseduffield/lazygit)|\n\n### Development Tools\n\n| Tool Name     | Version | Description                                 | Link                                        |\n|---------------|---------|---------------------------------------------|---------------------------------------------|\n| `neovim`      | Latest  | Vim-based text editor with extended features| [Neovim](https://neovim.io/)                |\n| `LazyVim`     | Latest  | Neovim configuration framework              | [LazyVim](https://www.lazyvim.org/)         |\n| `code-server` | Latest  | Run VSCode in the browser                   | [code-server](https://coder.com/)           |\n| `ttyd`        | Latest  | Share terminal over the web                 | [ttyd](https://tsl0922.github.io/ttyd/)     |\n\n### Cloud Native Tools\n\n| Tool Name    | Version | Description                            | Link                                      |\n|--------------|---------|----------------------------------------|-------------------------------------------|\n| `kubectl`    | Latest  | Kubernetes command-line tool           | [kubectl](https://kubernetes.io/docs/tasks/tools/) |\n| `k9s`        | Latest  | Terminal UI for Kubernetes clusters    | [k9s](https://k9scli.io/)                 |\n| `helm`       | Latest  | Kubernetes package manager             | [Helm](https://helm.sh/)                  |\n| `kubectx`    | Latest  | Switch between clusters                | [kubectx](https://github.com/ahmetb/kubectx)|\n| `kubens`     | Latest  | Switch between namespaces              | [kubens](https://github.com/ahmetb/kubectx)|\n| `krew`       | Latest  | Package manager for kubectl plugins    | [krew](https://krew.sigs.k8s.io/)         |\n| `Pulumi`     | Latest  | Infrastructure as Code SDK             | [Pulumi](https://www.pulumi.com/)         |\n| `pulumictl`  | Latest  | Pulumi control utility                 | [pulumictl](https://github.com/pulumi/pulumictl)|\n| `esc`        | Latest  | Pulumi environment service CLI         | [esc](https://github.com/pulumi/esc)      |\n| `kind`       | Latest  | Run local Kubernetes clusters          | [kind](https://kind.sigs.k8s.io/)         |\n| `cilium`     | Latest  | CLI for installing and managing Cilium | [Cilium](https://cilium.io/)              |\n| `istioctl`   | Latest  | Istio service mesh CLI                 | [Istioctl](https://istio.io/latest/docs/ops/diagnostic-tools/istioctl/)|\n| `clusterctl` | Latest  | Kubernetes Cluster API CLI             | [Cluster API](https://cluster-api.sigs.k8s.io/)|\n| `talosctl`   | Latest  | CLI tool for managing Talos clusters   | [Talos](https://www.talos.dev/)           |\n\n## Configuration and Environment\n\n### Environment Variables\n\n- `DEVCONTAINER`: Indicates the current devcontainer variant.\n- `PATH`: Includes common binary directories and language-specific paths.\n- `NIX_INSTALLER_EXTRA_CONF`: Nix configuration for system builds.\n- `REGISTRY_AUTH_FILE`: Path to Docker registry authentication.\n- `BIN`: Default binary installation directory (`/usr/local/bin`).\n- `INSTALL`: Default binary install command (`install -m 755 -o root -g root`).\n- `STARSHIP_CONTAINER`: Container name for Starship prompt.\n\n### User and Permission Model\n\n- **Users**:\n  - `vscode` (UID 1000): Primary user with sudo privileges.\n  - `runner` (UID 1001): Secondary user for GitHub Actions compatibility.\n- **Groups**:\n  - `sudo`: For administrative privileges.\n  - `docker`: For Docker access.\n- **Permissions**:\n  - Password-less sudo for `vscode` and `runner`.\n  - Proper file permissions set for home directories and configuration files.\n\n### Volume Mounts and Ports\n\n- **Workspace Mount**:\n  - Mount your code into the container using `-v \"$(pwd):/workspace\"`.\n- **Exposed Ports**:\n  - `8080`: Exposed for code-server (VSCode in browser).\n  - `1313`: Exposed for Hugo server (in `hugo` variant).\n- **Docker-in-Docker**:\n  - Requires `--privileged` flag to run Docker inside the container.\n\n### Shell Customizations\n\n- **Starship Prompt**:\n  - Configured with a custom theme and displays the container name.\n- **Tmux**:\n  - Pre-configured with plugins and custom settings.\n  - Session management and automatic start scripts.\n- **Neovim**:\n  - Configured with LazyVim, LSP support, and essential plugins.\n  - Custom key mappings and settings.\n\n## Usage\n\n### Quick Start Guides\n\n#### Running the Slim Variant\n\n```bash\ndocker run -it --rm \\\n  --name devcontainer \\\n  --hostname devcontainer \\\n  --entrypoint bash \\\n  ghcr.io/containercraft/devcontainer:slim\n```\n\n#### Accessing Neovim\n\n```bash\ndocker run -it --rm \\\n  --name neovim \\\n  --hostname neovim \\\n  --entrypoint bash \\\n  -v \"$(pwd):/workspace\" \\\n  ghcr.io/containercraft/devcontainer:nvim\n```\n\n#### Using Docker-in-Docker\n\n```bash\ndocker run --privileged --rm -d \\\n  --name dind \\\n  --hostname dind \\\n  ghcr.io/containercraft/devcontainer:dind\n```\n\n### Volume and Network Configuration\n\n- **Mounting Code**:\n  - Use `-v \"$(pwd):/workspace\"` to mount your current directory into the container.\n- **Persisting Data**:\n  - Use Docker volumes to persist data across container restarts.\n  - Example: `-v mydata:/path/in/container`\n- **Network Ports**:\n  - Map container ports to host ports using the `-p` flag.\n  - Example: `-p 8080:8080` maps container port 8080 to host port 8080.\n\n## Technical Specifications\n\n### Container Configuration\n\n- **Base Images**:\n  - Based on official Ubuntu images and Microsoft's devcontainers.\n- **User Space**:\n  - Users `vscode` and `runner` with proper UID and GID.\n  - Home directories set up with necessary configurations.\n- **Directory Structure**:\n  - `/home/vscode`: Home directory for primary user.\n  - `/workspace`: Default working directory (when mounted).\n  - `/usr/local/bin`: Default directory for installed binaries.\n\n### Tool Chain Details\n\n- **Updates**:\n  - Tools are installed using the latest stable releases from official sources.\n  - Regular updates are made to keep the toolchain current.\n- **Compatibility**:\n  - Configured to work seamlessly with common development tools and workflows.\n  - Supports integration with VSCode extensions and Neovim plugins.\n- **Default Configurations**:\n  - Pre-set configurations for tools like Neovim, tmux, and Starship.\n  - Environment variables and shell aliases for improved productivity.\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nThis project is licensed under the [Adaptive Public License Version 1.0](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainercraft%2Fdevcontainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontainercraft%2Fdevcontainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainercraft%2Fdevcontainer/lists"}