Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Dev Container Generator (devcontainer.json, Dockerfile and Compose)

Pick an image, Features, ports and commands: get a checked .devcontainer folder.

Free preview, no sign-upIncluded in your pass Pro tool Pro pass: ₹179 / $5.99 for 30 days On this device: nothing is sent
+3 +1 more details No uploadWorks offline once opened Developer

Free preview: the generated files with the Features and lifecycle commands hidden, every check, and what each setting does. Locked until you unlock it: download and copy.

Pro pass ₹179 for 30 days or ₹79 for 1 week, one‑time. Pro pass $5.99 for 30 days or $2.99 for 1 week, one‑time. How to unlock

Try before you buy.

  • Free preview: the generated files with the Features and lifecycle commands hidden, every check, and what each setting does.
  • Locked until you unlock it: download and copy.
  • Unlock: Pro pass, ₹179 for 30 days or ₹79 for 1 week, a one-time payment that never renews. Unlock: Pro pass, $5.99 for 30 days or $2.99 for 1 week, a one-time payment that never renews.

Ways to unlock shows how to get the full result.

See passes (opens in a new tab)

Printing this result is locked in the free preview.

Container

Editors show it when you open or switch containers.

How the container starts

Features
Containers and Kubernetes
Cloud command lines
Tools
More languages

A reference from containers.dev/features, optionally followed by its options as JSON.

Editor

publisher.name, as on the extension’s Marketplace page. Suggested puts in the ones for the language you picked.

Ports

A number such as 3000, or service:port (postgres:5432) for another Compose service.

Lifecycle commands

Runs on your computer (the host), before the container is created, and again on later starts.

Runs inside the container right after it is first created.

Runs after onCreateCommand when new source content arrives while the container is created (prebuilds use it).

Runs once the container is created and assigned to you: installing dependencies is the usual job.

Runs every time the container starts.

Runs every time an editor attaches to the container.

Several lines run one after the other (joined with &&).

Environment variables

A name like PASSWORD, TOKEN, SECRET or KEY is written as ${localEnv:NAME}: the value then comes from your computer, not the repository.

Mounts

A volume keeps data across rebuilds; a bind mount shares a folder of your computer (write ${localEnv:HOME}, not ~).

User and host

Empty: the image’s own user.

Advanced

Next steps Done. What next?

Start over

A Pro pass unlocks the full result. See passes

All developer tools

About the Dev Container Generator (devcontainer.json, Dockerfile and Compose)

Describe the development environment of a project and get its .devcontainer folder: devcontainer.json, plus a Dockerfile and a docker-compose.yml when the setup needs them. VS Code’s Dev Containers extension, GitHub Codespaces, JetBrains IDEs and the devcontainer command line all open the same folder, so everyone who works on the project gets the same tools in seconds.

Start from an official dev container image — Node.js, TypeScript, Python, Java, Go, .NET, PHP, Ruby, Rust, C++, plain Debian, Ubuntu or Alpine — or an image or Dockerfile of your own, or a Docker Compose setup with PostgreSQL, MySQL, MariaDB, Redis or MongoDB. Add official Dev Container Features (Docker in Docker, the GitHub, AWS and Azure command lines, kubectl and Helm, Terraform, more Node.js or Python versions…), editor extensions and settings, forwarded ports with labels, lifecycle commands such as postCreateCommand, environment variables, mounts, the user and the host’s minimum CPUs and memory.

Every value is checked as you type, the file is checked against the official devcontainer.json schema, and a table explains what each property does. Without a pass the result is a free preview: the files with their Features and lifecycle commands hidden, every check and the explanations; copying the files and the ZIP unlock with a Pro pass.

How to use it

  1. Choose how the container starts: a prebuilt image, a Dockerfile from that image (to add operating system packages), your own Dockerfile, or Docker Compose with databases.
  2. Pick the language and its version, then tick Features and set their options.
  3. Add editor extensions, ports to forward, the commands to run (postCreateCommand installs dependencies) and environment variables; open the other sections for mounts, the user and the host’s requirements.
  4. Read the checks under the files: errors must be fixed, warnings are likely mistakes, notes explain a choice.
  5. With a Pro pass, download the ZIP (or copy each file) and unzip it in the root of your project; without one the page shows the free preview. Then open the project in your editor and reopen it in the container.

Examples

A Python project with Docker in Docker
Input
Prebuilt image · Python 3.14 · Debian 13 (trixie) · Docker in Docker · port 8000 · postCreateCommand: pip install --user -r requirements.txt
Result
{
  "name": "Python",
  "image": "mcr.microsoft.com/devcontainers/python:3-3.14-trixie",
  "features": {
    "ghcr.io/devcontainers/features/docker-in-docker:4": {}
  },
  "forwardPorts": [8000],
  "postCreateCommand": "pip install --user -r requirements.txt"
}
A TypeScript API with PostgreSQL and Redis
Input
Docker Compose · TypeScript (Node.js 24) · PostgreSQL · Redis · ports 3000 and postgres:5432
Result
devcontainer.json (dockerComposeFile, service "app", workspaceFolder /workspaces/${localWorkspaceFolderBasename}), a Dockerfile FROM mcr.microsoft.com/devcontainers/typescript-node:5-24-trixie and docker-compose.yml with postgres:18 and redis:8.10, each with a healthcheck and a named volume; the app waits for both and gets DATABASE_URL and REDIS_URL.
A token in the environment
Input
Container environment: GITHUB_TOKEN=ghp_abc123
Result
"containerEnv": { "GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}" }

devcontainer.json is usually committed with the code, so a value whose name looks like a secret is written as a reference to the variable on your own computer.

Common uses

  • Giving a team or an open-source project a one-click development environment in VS Code or GitHub Codespaces.
  • Adding a database to a dev container without learning the Compose file format first.
  • Turning an onboarding page of install steps into Features and a postCreateCommand that run by themselves.
  • Checking which lifecycle command runs when, and what each property of devcontainer.json does.

What goes into the folder

  • devcontainer.json in the .devcontainer folder: the image (or the build, or the Compose service), Features, ports, commands, environment, mounts, customizations.vscode and the host requirements. Only what you set is written; everything else keeps the editor’s default.
  • Dockerfile (with “A Dockerfile from this image” and with Docker Compose): FROM the official image, then your operating system packages in one apt-get layer (apk on Alpine) and your own lines.
  • docker-compose.yml (Docker Compose): the app service your editor works in (the project folder mounted at /workspaces, sleep infinity so it keeps running), each database with a named volume and a healthcheck, the app waiting for them with condition: service_healthy, and a shared network, as in the official templates. The app gets DATABASE_URL, REDIS_URL or MONGODB_URI; the passwords are simple local ones, for development only.

Images, Features and versions

Images come from Microsoft’s dev container images at mcr.microsoft.com/devcontainers, written as the registry tags them: the image’s major version, then the language version and the operating system (javascript-node:5-24-trixie), so you get fixes without a sudden major change. They already include Git, a non-root user (node for Node.js and TypeScript, codespace for Universal, vscode for the others) and common tools. Features are the official Dev Container Features at ghcr.io/devcontainers/features, each pinned to its current major version; only the options you change are written, so the Feature’s defaults apply to the rest. Any other Feature can be added by its reference under More Features.

The checks

  • Your values: port numbers and service:port forms, environment variable names, mount paths (a bind mount needs a source; ~ is not expanded, so the page tells you to use ${localEnv:HOME}), extension ids, settings JSON, user names, CPUs and memory sizes, package names and Dockerfile lines.
  • Combinations: two Docker Features, a Feature that duplicates what the image has, a command waitFor names that is empty, two SQL databases giving the app one DATABASE_URL, privileged mode without a tool that needs it.
  • Secrets: a variable named like a password, token or key is written as ${localEnv:NAME}, because devcontainer.json is usually committed.
  • The official schema: the finished devcontainer.json is validated against the devcontainer.json schema of the Development Containers Specification and the VS Code part of it, bundled with the page.

The lifecycle commands, in order

  • initializeCommand runs on your computer before the container is created.
  • onCreateCommand and then updateContentCommand run inside the container while it is created.
  • postCreateCommand runs once the container is ready: installing dependencies is its usual job.
  • postStartCommand runs every time the container starts, postAttachCommand every time an editor attaches.

A command written on several lines runs them one after the other (joined with &&). If one lifecycle command fails, the later ones do not run (JSON reference).

Limitations

  • The page does not build or start the container: open the folder in VS Code (Dev Containers), Codespaces or with the devcontainer command line to do that.
  • Feature options are offered for the common cases; set any other option by adding the Feature under More Features with its options as JSON.
  • Lifecycle commands are written as one shell command each; the array and parallel-object forms of the specification are not offered.
  • Settings are checked as JSON, not against every setting VS Code knows.
  • Browsers save a downloaded file without a leading dot in some cases; the ZIP keeps the .devcontainer folder name as it is.

Privacy

On this device: nothing is sent

Everything is generated and checked in your browser; nothing you enter is uploaded. Your last settings are remembered on this device.

Frequently asked questions

What do I get without a pass?

Without a pass, Dev Container Generator (devcontainer.json, Dockerfile and Compose) shows the generated files with the Features and lifecycle commands hidden, every check, and what each setting does. Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.

Which editors read devcontainer.json?

VS Code with the Dev Containers extension, GitHub Codespaces, JetBrains IDEs through their dev container support, and the open-source devcontainer command line, among others listed on containers.dev. The customizations.vscode part applies to VS Code and Codespaces; other tools ignore it.

Where do I put the files?

In the root of your project: the ZIP holds a .devcontainer folder with devcontainer.json and, when needed, the Dockerfile and docker-compose.yml. Commit the folder, then choose “Reopen in Container” in VS Code or create a codespace from the repository.

Prebuilt image or Dockerfile?

A prebuilt image starts fastest and is enough when Features cover what you need. Choose a Dockerfile when you need operating system packages (a database client, a C library) or your own setup steps, and Docker Compose when the project needs a database or a cache next to it.

How do I keep a token out of the repository?

Put it in an environment variable on your computer and write ${localEnv:NAME} in devcontainer.json; the page does that for you when a variable’s name looks like a secret. In Codespaces, add it as a Codespaces secret.

Why are the database passwords so simple?

They are for the database inside your local dev container, which only the containers of the setup can reach, as in the official templates. Never use them for a database on a server.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.