Development Container Images

repository·main·Indexed 24 days ago

https://github.com/devcontainers/images

A collection of published Docker images optimized for use as development containers, following the Development Containers Specification. The repository provides pre-built images for various environments including Anaconda (Python 3), C++, C# (.NET), and base images for Alpine, Debian, and Ubuntu. It includes guidance on using these images in devcontainer.json, managing package managers like conda and Vcpkg, and best practices for Dockerfile RUN statements.

Tokens
202.8K
Snippets
532
Records
991
Agent score
82%

What's inside devcontainers-images

  1. Overview of the Universal Dev Container Image

    main

    The Universal image is a comprehensive development environment containing a wide array of languages, runtimes, and tools. It features dynamic detection logic that automatically installs additional language or runtime versions based on the contents of your repository. Dynamically installed content is located in sub-folders under /opt.

    Key Specifications (Version 2.0.20):

    • Linux Distribution: Ubuntu 20.04.5 LTS
    • Architecture: linux/amd64
    • Default Non-root User: codespace
    • Available Tags:
      • mcr.microsoft.com/devcontainers/universal:2.0.20-focal
      • mcr.microsoft.com/devcontainers/universal:2.0.20-linux
      • mcr.microsoft.com/devcontainers/universal:2.0.20

    Best Practice for Tagging: To ensure you receive updates without breaking changes, use partial version numbers:

    • Use the major version (e.g., 0-) to receive all non-breaking changes.
    • Use major and minor versions (e.g., 0.200-) to receive only fixes.
  2. Identify the codespaces-linux image details

    main

    The codespaces-linux image is the default GitHub Codespaces dev container image. It is based on Ubuntu 20.04.3 LTS and includes detection logic to dynamically install additional language or runtime versions based on your repository's contents. Dynamically installed content is located in sub-folders under /opt.

    Key Metadata (Version 1.6.6):

    • Linux distribution: Ubuntu 20.04.3 LTS
    • Architecture: linux/amd64
    • Non-root user: codespace
    • Digest: sha256:83ca44781399a2e195f3dc7f009dc27d4555468ce299da5e499e8ea7abbd0455
  3. What are Development Container Images?

    main

    Development Container Images are published Docker images designed to be used as development containers. A development container is a running Docker container with a well-defined tool/runtime stack and its prerequisites. These images allow you to use a container as a full-featured development environment to:

    • Run an application.
    • Separate tools, libraries, or runtimes needed for working with a codebase.
    • Aid in continuous integration and testing.

    The images in this repository are built using dev container features.

  4. Use TypeScript Node dev container images

    main

    The typescript-node dev container images provide a pre-configured environment for TypeScript and Node.js development. These images include Node.js, TypeScript, nvm (Node Version Manager), Oh My Zsh!, and several globally installed npm packages like eslint and typescript.

    Best Practices for Versioning

    To ensure your environment stays up to date with non-breaking changes or specific fixes, use partial version numbers in your image tags:

    • To get all non-breaking changes: Use the major version number followed by a hyphen (e.g., 0-).
    • To get only fixes: Use the major and minor version numbers followed by a hyphen (e.g., 0.200-).
  5. Use the Universal image for multi-language development

    main
    The Universal image is a pre-configured development environment that includes a wide variety of languages, runtimes, and tools. It also features dynamic detection logic that automatically installs additional language or runtime versions based on the contents of your repository. Dynamically installed content is located in sub-folders under /opt.
  6. Use the Universal image for development

    main

    The Universal image is a comprehensive development environment based on Ubuntu 20.04.6 LTS. It includes a wide array of pre-installed languages, runtimes, and tools.

    Key Feature: Dynamic Installation The image includes detection logic that dynamically installs additional language or runtime versions based on the contents of your repository. These dynamically installed components are located in sub-folders under /opt.

  7. Available C++ Dev Container Image Variants

    main

    The C++ development container images are available in several Linux distribution variants. Choose the variant that best matches your project's requirements or preferred OS environment.

    Supported Variants

    • trixie: Debian GNU/Linux 13 (trixie)
    • bookworm: Debian GNU/Linux 12 (bookworm)
    • noble: Ubuntu 24.04.4 LTS
    • jammy: Ubuntu 22.04.5 LTS

    All variants support linux/amd64 and linux/arm64 architectures and provide a non-root user named vscode.

  8. Configure Conda and Python environments

    main

    This image includes the conda package manager.

    Using Conda Channels

    The base environment uses the conda default channel. To avoid conflicts, it is recommended to create a new conda environment rather than installing packages from different channels (like conda-forge) into the same environment.

    Automatic dependency installation via environment.yml

    By default, the image automatically installs dependencies from an environment.yml file located in the parent folder during the build process. This behavior is controlled by the following logic in the Dockerfile:

    RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
        && rm -rf /tmp/conda-tmp
  9. Configure Jekyll dependency installation

    main

    The Jekyll development container handles gem installation automatically at startup based on your project structure:

    • With a Gemfile (Recommended): If a Gemfile exists in the root folder, the container runs bundle install at startup. This allows you to specify exact Jekyll versions and plugins.
    • Without a Gemfile: The container installs the latest version of Jekyll automatically. However, you will need to manually install any other dependencies or Jekyll plugins your project requires.
  10. Tools and Runtimes in C++ Dev Container Images

    main

    The C++ Dev Container images come pre-installed with essential development tools. While specific versions vary by OS variant (Bookworm, Bullseye, Buster, or Noble), they all include:

    Core Languages and Runtimes

    • GCC (GNU Compiler Collection)
    • Clang (LLVM Compiler Infrastructure)

    Package Management and Shell

    • vcpkg: C/C++ package manager (installed at /usr/local/vcpkg)
    • Oh My Zsh!: Zsh framework (installed at /home/vscode/.oh-my-zsh or /home/ubuntu/.oh-my-zsh)
    • git: Version control

    Build and Debugging Utilities

    • cmake: Build system generator
    • ninja-build: Small build system focused on speed
    • gdb / lldb: Debuggers
    • cppcheck: Static analysis tool
    • valgrind: Memory debugging and profiling tool
    • pkg-config: Helper for managing library compile/link flags
  11. Compare C++ image variants by distribution

    main

    The following table summarizes the core language runtimes and tools available in the different distribution variants of the C++ image (version 1.2.14).

    FeatureBookworm (Debian 12)Bullseye (Debian 11)Noble (Ubuntu 24.04)Jammy (Ubuntu 22.04)
    GCC12.2.010.2.113.3.011.4.0
    Clang14.0.611.0.118.1.314.0.0
    CMake3.25.13.18.43.28.33.22.1
    vcpkg/usr/local/vcpkg/usr/local/vcpkg/usr/local/vcpkg/usr/local/vcpkg
    Oh My Zsh!/home/vscode/.oh-my-zsh/home/vscode/.oh-my-zsh/home/vscode/.oh-my-zsh/home/vscode/.oh-my-zsh