Docker (Docker-in-Docker)

Creates child containers using Docker daemons supervised as native s6-overlay services.

Install

Add to devcontainer.json

"features": {
  "ghcr.io/wyrd-company/devcontainers/docker-in-docker:1": {}
}

README

Docker (Docker-in-Docker) (docker-in-docker)

Creates child containers using Docker daemons supervised as native s6-overlay services.

Example Usage

"features": {
    "ghcr.io/wyrd-company/devcontainers/docker-in-docker:1": {}
}

Options

Options IdDescriptionTypeDefault Value
versionSelect or enter a Docker/Moby Engine version. (Availability can vary by OS version.)stringlatest
mobyInstall Microsoft-packaged Moby instead of Docker CE when the complete package set is availablebooleanfalse
mobyBuildxVersionInstall a specific version of moby-buildx when using Mobystringlatest
dockerDashComposeVersionDefault version of Docker Compose (v1, v2, latest or none)stringlatest
azureDnsAutoDetectionAllow automatically setting the dockerd DNS server when the installation script detects it is running in Azurebooleantrue
dockerDefaultAddressPoolDefine default address pools for Docker networks. e.g. base=192.168.0.0/16,size=24string-
installDockerBuildxInstall Docker Buildxbooleantrue
installDockerComposeSwitchInstall Compose Switch (provided docker compose is available) which is a replacement to the Compose V1 docker-compose (python) executable. It translates the command line into Compose V2 docker compose then runs the latter.booleanfalse
disableIp6tablesDisable ip6tables (this option is only applicable for Docker versions 27 and greater)booleanfalse
iptablesSwitchAtRuntimeIf true, the iptables alternative is selected by the s6 preparation service at container start. Useful when the desired iptables backend depends on the host kernel at runtime rather than at build time.booleantrue

Customizations

VS Code Extensions

Limitations

The image must use s6-overlay 3 with /init as its entrypoint. Set "overrideCommand": false in devcontainer.json so s6 remains PID 1. Docker CE is the default; "moby": true is an explicit opt-in and fails when the complete Moby package set is unavailable.

This docker-in-docker Dev Container Feature is roughly based on the official docker-in-docker wrapper script that is part of the Moby project. With this in mind:

  • As the name implies, the Feature is expected to work when the host is running Docker (or the OSS Moby container engine it is built on). It may be possible to get running in other container engines, but it has not been tested with them.
  • The host and the container must be running on the same chip architecture. You will not be able to use it with an emulated x86 image with Docker Desktop on an Apple Silicon Mac, like in this example:
    FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/typescript-node:16
    See Issue #219 for more details.

OS Support

This Feature should work on recent versions of Debian/Ubuntu-based distributions with the apt package manager installed.

bash is required to execute the install.sh script.


Note: This file was auto-generated from the devcontainer-feature.json. Add additional notes to a NOTES.md.

Ansible

When the Ansible Feature is installed, Docker starts only after the ansible-setup s6-rc oneshot finishes. If the oneshot fails, Docker does not start. This Feature declares installsAfter for the Ansible Feature, so that the ansible-setup service definition exists when this installer runs. The installer adds the dependency only when that definition exists. Without Ansible, startup does not change. The preparation oneshot waits, so containerd and dockerd also wait.

Trademarks

This feature is not affiliated with or endorsed by Docker, Inc. Docker and its logo are trademarks of Docker, Inc. All trademarks and copyrights belong to their holders. The logo is used only to identify the software that this feature installs.

Logo: the Docker mark from the Docker media resources (docker-mark-ocean-blue.svg).

Releases

Latest 1.1.0

Features

  • When the Ansible Feature is installed, the services of this Feature start after its ansible-setup oneshot succeeds. Without Ansible, startup does not change. The Feature adds the Ansible Feature to installsAfter.
All releases