Skip to content
Skills Library
DevOps & cloud · Building & coding

devcontainers

/devcontainers

Define reproducible development environments with Dev Containers. Use when a user asks to standardize dev environments, set up VS Code remote containers, create reproducible dev setups, or onboard developers faster.

Repository
skills ↗
Licence
Apache-2.0
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Define reproducible development environments with Dev Containers. Use when a user asks to standardize dev environments, set up VS Code remote containers, create reproducible dev setups, or onboard developers faster.

Original author description

Define reproducible development environments with Dev Containers. Use when a user asks to standardize dev environments, set up VS Code remote containers, create reproducible dev setups, or onboard developers faster.

How it works

  1. Overview
  2. Instructions
  3. Examples
  4. Guidelines
Original SKILL.md headings · 75 lines, 449 words
SKILL.md preview
---
name: devcontainers
description: >-
  Define reproducible development environments with Dev Containers. Use when a user asks to standardize dev environments, set up VS Code remote containers, create reproducible dev setups, or onboard developers faster.
license: Apache-2.0
compatibility: 'VS Code, GitHub Codespaces'
metadata:
  author: terminal-skills
  version: "1.1.0"
  category: development
  tags: "devcontainers, docker, vscode, codespaces, reproducible"
  repository: https://github.com/devcontainers/spec
---

# Dev Containers

## Overview
Dev Containers define reproducible development environments in Docker. Open a repo in VS Code or GitHub Codespaces and get the exact same environment — tools, extensions, settings pre-installed.

## Instructions

### Step 1: Basic Config
```jsonc
// .devcontainer/devcontainer.json — Dev environment definition
{
  "name": "My Project",
  "image": "mcr.microsoft.com/devcontainers/typescript-node:20",
  "features": {
    "ghcr.io/devcontainers/features/docker-in-docker:4": {},
    "ghcr.io/devcontainers/features/github-cli:1": {}
  },
  "forwardPorts": [3000, 5432],
  "postCreateCommand": "npm install",
  "customizations": {
    "vscode": {
      "extensions": [
        "dbaeumer.vscode-eslint",
        "esbenp.prettier-vscode"
      ],
      "settings": { "editor.formatOnSave": true }
    }
  }
}
```

### Step 2: With Database
```yaml
# .devcontainer/docker-compose.yml
services:
  app:
    image: mcr.microsoft.com/devcontainers/typescript-node:20
    volumes: [../:/workspace:cached]
    command: sleep infinity
  db:
    image: postgres:16
    environment:
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: myapp
    volumes: [pgdata:/var/lib/postgresql/data]
volumes:
  pgdata:
```

## Examples

### Example 1: "Our new hires spend a day installing the right Node version, Postgres, and CLI tools before they can run the app"

Add a `.devcontainer/devcontainer.json` at the repo root using the config in Step 1 above, committing it to version control. A new hire clones the repo, opens it in VS Code, clicks "Reopen in Container" when prompted (or runs the "Dev Containers: Reopen in Container" command), and VS Code builds the image, runs `postCreateCommand` (`npm install`), and attaches with the listed extensions already installed. No local Node, Postgres, or CLI setup is needed on the host machine.

You can also build and run the same definition from the command line (CI, or without VS Code) using the standalone CLI:

```bash
npm install -g @devcontainers/cli
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . npm test
```

### Example 2: "Our app needs Postgres running alongside it for local development, not just the app container"

Use the Docker Compose variant in Step 2: a `.devcontainer/docker-compose.yml` with an `app` service (the dev container, kept alive with `command: sleep infinity` so VS Code can attach) and a `db` service (`postgres:16`) sharing a Docker network, plus a `.devcontainer/devcontainer.json` that points `dockerComposeFile` at it and sets `service: "app"` and `workspaceFolder: "/workspace"`. Opening the folder in VS Code starts both containers; the app connects to Postgres at host `db`, port `5432`.

## Guidelines
- New developer: clone → open in VS Code → "Reopen in Container" → ready.
- Features marketplace (`ghcr.io/devcontainers/features/*`) adds tools without custom Dockerfiles; pin a major version (e.g. `:4`) rather than `:latest` so builds stay reproducible.
- Works with GitHub Codespaces — same config, cloud-hosted; also supported by JetBrains IDEs and the standalone `devcontainer` CLI (`@devcontainers/cli`), not just VS Code.
- `postCreateCommand` runs once after the container is created; use `postStartCommand` for logic that should run every time the container starts (e.g. after a rebuild or restart).
- Keep the image/Dockerfile layer caching-friendly — install dependencies before copying source so rebuilds stay fast.
Files in this package (2)
  • SKILL.md 4 KB
  • _scores.json 3 KB

Versions

RepositoryScoreLicence
This page · TerminalSkills/skills100Apache-2.0
digitalocean-labs/do-app-platform-skills100MIT
joeblackwaslike/agent-skills100MIT
uw-ssec/rse-plugins100BSD-3-Clause

Database snapshot: 13.11.2026 · package version 629afe7322f7 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100dev-containers-docker-remote-development
    Use this skill when standardizing developer toolchains and isolated runtime environments using VS Code Dev Containers.
  • 88dev-loop-dev-container
    Use when the user asks about development containers, devcontainer.json, Dev Containers in VS Code/GitHub Codespaces, Docker-based dev environments, or reproducible development setups. Do NOT use for: production Dockerfiles, or CI/CD pipelines.
  • 100system-environment-setup
    Configure development and production environments for consistent and reproducible setups. Use when setting up new projects, Docker environments, or development tooling. Handles Docker Compose, .env configuration, dev containers, and infrastructure as code.
  • 100pave-env
    Set up local development environments — devcontainers, Docker Compose, one-command setup, dev/prod parity. Use when asked to "set up dev environment", "devcontainer", "docker compose for dev", "local development setup", or "one command to run".
  • 95system-environment-setup
    Build reproducible developer environments for real projects: local toolchains, runtime versions, Docker Compose or dev containers, onboarding flows, local service parity, bootstrap scripts, and environment troubleshooting. Use when the user needs a repo to run consistently…
  • 95skill-148
    Expert guidance for Development Containers (devcontainers) in VS Code. Create, configure, and manage devcontainer.json files, use Templates and Features, integrate with Docker/Docker Compose, and troubleshoot common issues. Use when working with devcontainers, containerized…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.