Dev Container Templates

repository·main·Indexed 23 days ago

https://github.com/devcontainers/templates

A collection of Dev Container Templates that encode complete development environment configurations. These templates can be used via Visual Studio Code, GitHub Codespaces, or the @devcontainers/cli to quickly set up containerized environments. The repository includes templates for Alpine, Debian, Anaconda, C++, and C++ with MariaDB, providing pre-configured images and options for OS variants and tool versions.

Tokens
22K
Snippets
80
Records
162
Agent score
77%

What's inside devcontainers-templates

  1. How to use Dev Container Templates

    main

    Dev Container Templates are sets of source files that encode configuration for a complete development environment. You can use them in two primary ways:

    1. Using supporting tools: Tools like Visual Studio Code and GitHub Codespaces provide direct integrations to configure templates hosted in this repository. You can also customize these environments using available Features.
    2. Using the Dev Container CLI: Use the @devcontainers/cli to programmatically apply templates from an OCI registry to your project workspace.
  2. Use the Node.js & TypeScript (typescript-node) template

    main

    The typescript-node template is designed for developing Node.js applications using TypeScript. It provides a pre-configured environment including:

    • Node.js
    • ESLint
    • NVM (Node Version Manager)
    • Yarn
    • TypeScript compiler

    This template uses a pre-built image (mcr.microsoft.com/devcontainers/typescript-node) that automatically includes the necessary devcontainer.json metadata.

  3. Use the Jekyll devcontainer template

    main

    The Jekyll template provides a complete environment for developing static sites with Jekyll. It uses a pre-built image that automatically includes the necessary devcontainer.json metadata.

    Image Details:

    • Image: mcr.microsoft.com/devcontainers/jekyll
    • Metadata: Automatically applies devcontainer.json contents from the image.
  4. Use the Miniconda (Python 3) template

    main

    The Miniconda template is designed for developing applications in Python 3. It provides a development container environment that includes the conda package manager, the Python extension, and automatically installs dependencies from an environment.yml file if present.

    Key Details:

    • Base Image: mcr.microsoft.com/devcontainers/miniconda
    • Automatic Metadata: This template uses a pre-built image that includes necessary devcontainer.json metadata.
    • Dependency Management: It automatically processes an environment.yml file located in the parent folder during the build process.
  5. Use the Markdown devcontainer template

    main

    The Markdown template provides a simple container environment optimized for editing markdown files. It uses a pre-built image that includes necessary devcontainer.json metadata automatically.

    Template Details:

    • Base Image: mcr.microsoft.com/devcontainers/base:debian
    • Metadata: The template automatically applies devcontainer.json contents from the base image.
  6. Use the Node.js & JavaScript (javascript-node) template

    main

    The javascript-node template is designed for developing Node.js based applications. It provides a pre-configured environment that includes:

    • Node.js
    • eslint
    • nvm
    • yarn

    This template uses a pre-built image (mcr.microsoft.com/devcontainers/javascript-node) that automatically includes the necessary devcontainer.json metadata.

  7. Use the Default Linux Universal template

    main

    The Default Linux Universal (universal) template provides an Ubuntu-based, large, multi-language container optimized for GitHub Codespaces. It uses a pre-built image that automatically includes necessary devcontainer.json metadata.

    Image Details:

    • Image: mcr.microsoft.com/devcontainers/universal
    • Metadata: Automatically applies devcontainer.json contents from the image.
  8. Use the F# (.NET) (dotnet-fsharp) template

    main

    The dotnet-fsharp template is designed for developing F# and .NET based applications. It provides a development environment that includes all necessary SDKs, extensions, and dependencies.

    This template utilizes a pre-built image that automatically includes required devcontainer.json metadata, reducing the need for manual configuration.

  9. Use the Rust (rust) Dev Container Template

    main
    The Rust template is designed for developing Rust-based applications. It provides a pre-configured environment including the necessary runtime arguments and tools to get started immediately. This template uses a pre-built image (mcr.microsoft.com/devcontainers/rust) that automatically includes required devcontainer.json metadata.
  10. Use the Java development container template

    main
    The Java template is designed for developing Java applications. It includes the JDK and Java extensions by default. This template uses a pre-built image (mcr.microsoft.com/devcontainers/java) that automatically includes the necessary devcontainer.json metadata.
  11. Use the forwardPorts property for local access

    main

    Many web frameworks and tools listen only on localhost inside the container. To make these ports accessible on your host machine, use the forwardPorts property in devcontainer.json.

    Unlike the ports property in docker-compose.yml (which publishes ports and may require applications to listen on 0.0.0.0 to work in cloud environments like Codespaces), forwardPorts works reliably for local development even if the application is bound to localhost.

    "forwardPorts": [9000]