Sign inSign up

C++ Development Container Images

Verified Publisher

devcontainers/cpp

By Microsoft

•Updated over 2 years ago

A dev container spec-supported image for working with C++.

5

microsoft/devcontainers-cpp repository overview

⁠C++

⁠About

Develop C++ applications on Linux. Includes Debian C++ build tools.

MetadataValue
CategoriesCore, Languages
Image typeDockerfile
Published imagesmcr.microsoft.com/devcontainers/cpp
Available image variantsdebian13, debian12, ubuntu26.04, ubuntu24.04, ubuntu22.04 (full list⁠)
Published image architecture(s)x86-64, aarch64/arm64 for debian13, debian12, ubuntu26.04, ubuntu24.04, and ubuntu22.04 variants
Container host OS supportLinux, macOS, Windows
Container OSDebian, Ubuntu
Languages, platformsC++

See history⁠ for information on the contents of published images.

⁠Using this image

You can directly reference pre-built versions of Dockerfile by using the image property in .devcontainer/devcontainer.json or updating the FROM statement in your own Dockerfile to one of the following. An example Dockerfile is included in this repository.

  • mcr.microsoft.com/devcontainers/cpp (latest Debian GA)
  • mcr.microsoft.com/devcontainers/cpp:debian (latest Debian GA)
  • mcr.microsoft.com/devcontainers/cpp:debian13 (or trixie)
  • mcr.microsoft.com/devcontainers/cpp:debian12 (or bookworm)
  • mcr.microsoft.com/devcontainers/cpp:ubuntu (latest Ubuntu LTS)
  • mcr.microsoft.com/devcontainers/cpp:ubuntu26.04 (or resolute)
  • mcr.microsoft.com/devcontainers/cpp:ubuntu24.04 (or noble)
  • mcr.microsoft.com/devcontainers/cpp:ubuntu22.04 (or jammy)

Refer to this guide⁠ for more details.

You can decide how often you want updates by referencing a semantic version⁠ of each image. For example:

  • mcr.microsoft.com/devcontainers/cpp:3-trixie
  • mcr.microsoft.com/devcontainers/cpp:3.0-trixie
  • mcr.microsoft.com/devcontainers/cpp:3.0.4-trixie
  • mcr.microsoft.com/devcontainers/cpp:3-bookworm
  • mcr.microsoft.com/devcontainers/cpp:3.0-bookworm
  • mcr.microsoft.com/devcontainers/cpp:3.0.4-bookworm

However, we only do security patching on the latest non-breaking, in support⁠ versions of images (e.g. 0-debian-12). You may want to run apt-get update && apt-get upgrade in your Dockerfile if you lock to a more specific version to at least pick up OS security updates.

See history⁠ for information on the contents of each version and here for a complete list of available tags⁠.

Alternatively, you can use the contents of .devcontainer⁠ to fully customize your container's contents or to build it for a container host architecture not supported by the image.

Beyond git, this image / Dockerfile includes zsh, Oh My Zsh!⁠, a non-root vscode user with sudo access, a set of common dependencies for development, and Vcpkg⁠ a cross-platform package manager for C++.

⁠Using Vcpkg

This dev container and its associated image includes a clone of the Vcpkg⁠ repo for library packages, and a bootstrapped instance of the Vcpkg-tool⁠ itself.

The minimum version of cmake required to install packages is higher than the version available in the main package repositories for Debian (<=11) and Ubuntu (<=21.10). Vcpkg will download a compatible version of cmake for its own use if that is the case (on x86_64 architectures).

Most additional library packages installed using Vcpkg will be downloaded from their official distribution locations⁠. To configure Vcpkg in this container to access an alternate registry, more information can be found here: Registries: Bring your own libraries to vcpkg⁠.

To update the available library packages, pull the latest from the git repository using the following command in the terminal:

cd "${VCPKG_ROOT}"
git pull --ff-only

Note: Please review the Vcpkg license details⁠ to better understand its own license and additional license information pertaining to library packages and supported ports.

⁠Support

The dev container spec images are maintained in the devcontainers/images⁠ repo. You can explore each image and open issues or feature requests.

⁠License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See LICENSE⁠.

Tag Summary

No tags have been pushed to this repository yet.