Develop C++ applications on Linux. Includes Debian C++ build tools.
| Metadata | Value |
|---|---|
| Categories | Core, Languages |
| Image type | Dockerfile |
| Published images | mcr.microsoft.com/devcontainers/cpp |
| Available image variants | debian13, debian12, ubuntu24.04, ubuntu22.04 (full list) |
| Published image architecture(s) | x86-64, aarch64/arm64 for debian13, debian12, ubuntu24.04 and ubuntu22.04 variants |
| Container host OS support | Linux, macOS, Windows |
| Container OS | Debian, Ubuntu |
| Languages, platforms | C++ |
See history for information on the contents of published images.
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(ortrixie)mcr.microsoft.com/devcontainers/cpp:debian12(orbookworm)mcr.microsoft.com/devcontainers/cpp:ubuntu(latest Ubuntu LTS)mcr.microsoft.com/devcontainers/cpp:ubuntu24.04(ornoble)mcr.microsoft.com/devcontainers/cpp:ubuntu22.04(orjammy)
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:2-trixiemcr.microsoft.com/devcontainers/cpp:2.1-trixiemcr.microsoft.com/devcontainers/cpp:2.1.5-trixiemcr.microsoft.com/devcontainers/cpp:2-bookwormmcr.microsoft.com/devcontainers/cpp:2.1-bookwormmcr.microsoft.com/devcontainers/cpp:2.1.5-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++.
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-onlyPlease install additonal system packages autoconf automake libtool m4 autoconf-archive to use vcpkg in manifest
mode. It can be added in the Dockerfile as following:
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install autoconf automake libtool m4 autoconf-archive \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
If building the image from source directly please uncomment respective # && apt-get -y install autoconf automake libtool m4 autoconf-archive \ line in Dockerfile.
Note: Please review the Vcpkg license details to better understand its own license and additional license information pertaining to library packages and supported ports.
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See LICENSE.