Przejdź do treści
Biblioteka skilli
Programowanie · Nauka i wyjaśnianie

devcontainers-best-practices

/devcontainers-best-practices

Udziela wskazówek o kontenerach deweloperskich, devcontainer.json, walidacji schematu oraz różnicach między VS Code, Zed, Codespaces i DevPod.

Repozytorium
ai-stack ↗
Licencja
MIT
Ostatnia zmiana repozytorium
13.11.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
9
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
36
Przestarzałość

Brak sygnałów. Repozytorium zmienione 13.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Udziela wskazówek o kontenerach deweloperskich, devcontainer.json, walidacji schematu oraz różnicach między VS Code, Zed, Codespaces i DevPod.

Wyzwalacze z opisu

t say
Oryginalny opis (EN)

Expert reference for the Dev Container ecosystem. Consult this skill whenever the user is setting up a dev container, configuring or debugging devcontainer.json, working in a Docker-based development environment, or asking about dev containers, GitHub Codespaces, DevPod, or Zed — even if they don't say "devcontainer" explicitly. Covers the full Dev Container spec, schema validation, tool-specific behaviors and limitations (VS Code, Cursor, Zed, Codespaces, CodeSandbox, Podman), Features and Templates (choosing, authoring, publishing), lifecycle scripts, environment variables, port forwarding,

Jak działa

  1. Quick start
  2. When to use this skill
  3. Canonical sources
  4. Reference files
  5. Quick lookup
  6. Best practices (from official docs)
  7. Summary
Sekcje z nagłówków SKILL.md, w oryginale · 92 linii, 936 słów
Podgląd SKILL.md
---
name: devcontainers-best-practices
description: Expert reference for the Dev Container ecosystem. Consult this skill whenever the user is setting up a dev container, configuring or debugging devcontainer.json, working in a Docker-based development environment, or asking about dev containers, GitHub Codespaces, DevPod, or Zed — even if they don't say "devcontainer" explicitly. Covers the full Dev Container spec, schema validation, tool-specific behaviors and limitations (VS Code, Cursor, Zed, Codespaces, CodeSandbox, Podman), Features and Templates (choosing, authoring, publishing), lifecycle scripts, environment variables, port forwarding, multi-container setups, and official best practices from containers.dev and devcontainers.github.io. Also use when the user is confused by container behavior that differs between tools, wants to write or publish a custom Feature, or needs to validate or debug a devcontainer.json.
license: MIT
metadata:
  author: Afonso Graça
---

# Devcontainers Best Practices

This skill guides you to the right documentation and references for the Development Container ecosystem. Use it when working with `devcontainer.json`, selecting Features or Templates, or when the user asks about dev containers, containers.dev, or supporting tools.

## Quick start

Minimal `devcontainer.json` using an image and a Feature: `"image": "mcr.microsoft.com/devcontainers/base:ubuntu"`, `"features": { "ghcr.io/devcontainers/features/git:1": {} }`. For property details and validation, see [Quick lookup](#quick-lookup) item 1 and [references/schema.md](references/schema.md).

## When to use this skill

- Editing or validating `devcontainer.json`
- Looking up a property (syntax, type, tool support)
- Choosing or referencing a Feature or Template
- Checking which tools support the spec or have tool-specific properties/limitations
- Understanding the spec (lifecycle, merge logic, image metadata)
- Authoring or publishing a Dev Container Feature (see the Authoring section in [references/features.md](references/features.md) and the [containers.dev authoring guide](https://containers.dev/guide/feature-authoring-best-practices))
- Configuring multiple dev containers (multi-project, shared Compose); see [references/tools.md](references/tools.md) and [VS Code / multi-container docs](https://code.visualstudio.com/docs/devcontainers/containers)

## Canonical sources

All content in this skill and its references is traceable to these sources:

- **Spec and reference**: [containers.dev/implementors/spec](https://containers.dev/implementors/spec/), [containers.dev/implementors/json_reference](https://containers.dev/implementors/json_reference/)
- **Schema**: [containers.dev/implementors/json_schema](https://containers.dev/implementors/json_schema/)
- **Guides**: [containers.dev/guides](https://containers.dev/guides) (prebuilds, using Dockerfile/Compose, Feature authoring best practices, GitLab CI)
- **Supporting tools**: [devcontainers.github.io/supporting](https://devcontainers.github.io/supporting)
- **Features**: [containers.dev/implementors/features](https://containers.dev/implementors/features/), [github.com/devcontainers/features](https://github.com/devcontainers/features)
- **Templates**: [containers.dev/implementors/templates](https://containers.dev/implementors/templates/), [github.com/devcontainers/templates](https://github.com/devcontainers/templates)

## Reference files

Detailed material is in the `references/` directory. Load only what you need.

| Need | File |
|------|------|
| When to use the full spec, key concepts, merge logic, lifecycle | [references/spec.md](references/spec.md) |
| JSON reference vs schema, canonical URLs, how to validate | [references/schema.md](references/schema.md) |
| Supporting tools, tool-specific properties, limitations | [references/tools.md](references/tools.md) |
| VS Code workflows, requirements, prebuild, ports, extensions, limitations, dotfiles, managing containers | [references/vscode-containers.md](references/vscode-containers.md) |
| Tips and tricks (OS, Git, performance, troubleshooting, profile persistence, reporting) | [references/tips-and-tricks.md](references/tips-and-tricks.md) |
| Official Features, OCI refs, versioning, options, install order, **authoring** Features | [references/features.md](references/features.md) |
| Official Templates, when to use template vs Feature vs Dockerfile | [references/templates.md](references/templates.md) |

## Quick lookup

1. **Property or behavior in devcontainer.json**  
   Use the [Dev Container metadata reference](https://containers.dev/implementors/json_reference/) (or [references/spec.md](references/spec.md)) for property-by-property details. For validation, use the [devcontainer.json schema](https://containers.dev/implementors/json_schema/) or Dev Container CLI; see [references/schema.md](references/schema.md).

2. **Tool support or tool-specific settings**  
   Check [devcontainers.github.io/supporting](https://devcontainers.github.io/supporting) for the list of tools, `customizations.*` (e.g. `customizations.vscode`, `customizations.codespaces`), and limitations. Summary in [references/tools.md](references/tools.md).

3. **Advanced scenarios (env vars, mounts, performance, non-root user, remote Docker, multiple containers, Git credentials)**  
   See [VS Code Advanced container configuration](https://code.visualstudio.com/remote/advancedcontainers/overview). Summary and workflow links in [references/vscode-containers.md](references/vscode-containers.md).

4. **Multiple dev containers (multi-project, shared Docker Compose)**  
   See [references/tools.md](references/tools.md) “Multiple containers / multi-project” and [Chris Ayers – Multiple dev containers](https://chris-ayers.com/posts/stir-trek-and-multiple-dev-containers/).

5. **OS-specific or troubleshooting (Git, Docker Desktop, cleanup, logs)**  
   See [VS Code Dev Containers Tips and Tricks](https://code.visualstudio.com/docs/devcontainers/tips-and-tricks). Summary in [references/tips-and-tricks.md](references/tips-and-tricks.md).

6. **Feature ID, options, or install order**  
   Official Features: [containers.dev/features](https://containers.dev/features), [github.com/devcontainers/features](https://github.com/devcontainers/features). OCI refs: `ghcr.io/devcontainers/features/<name>:<version>`. Details in [references/features.md](references/features.md). For **authoring** Features, see the Authoring section there and [containers.dev/guide/feature-authoring-best-practices](https://containers.dev/guide/feature-authoring-best-practices).

7. **Template or "template vs Feature vs Dockerfile"**  
   Official Templates: [containers.dev/templates](https://containers.dev/templates), [github.com/devcontainers/templates](https://github.com/devcontainers/templates). When to use which: [references/templates.md](references/templates.md).

8. **Spec concepts (lifecycle, merge, image metadata)**  
   Full spec: [containers.dev/implementors/spec](https://containers.dev/implementors/spec/). Summary: [references/spec.md](references/spec.md).

## Best practices (from official docs)

Only apply recommendations that are stated in the spec or official devcontainer documentation; cite the source when relevant.

- **Environment variables**: Prefer `containerEnv` over `remoteEnv` when possible so all processes in the container see the variable and it is not client-specific. Use `remoteEnv` when the value is not static and you want to avoid rebuilding. ([Dev Container metadata reference – containerEnv/remoteEnv](https://containers.dev/implementors/json_reference/).)
- **Port forwarding**: In most cases use the `forwardPorts` property rather than `appPort`; forwarded ports behave like localhost to the application. Use `appPort` (or Docker Compose `ports`) when you need published/network-visible ports. ([VS Code – Forwarding or publishing a port](https://code.visualstudio.com/docs/devcontainers/containers#forwarding-or-publishing-a-port), [Dev Container metadata reference](https://containers.dev/implementors/json_reference/).)
- **Pre-build when possible**: Pre-building images (e.g. with Dev Container CLI or GitHub Actions) speeds up startup and lets you pin tool versions; image metadata can be inherited so repos need only a minimal `devcontainer.json`. ([VS Code – Pre-building dev container images](https://code.visualstudio.com/docs/devcontainers/containers#pre-building-dev-container-images), [containers.dev/guides](https://containers.dev/guides).)
- **Security and trust**: Dev container configs and images can run arbitrary commands. Only use configs and images from trusted sources. For sandboxing and security context, see the spec and community articles (e.g. [The Red Guild – Where do you run your code](https://blog.theredguild.org/where-do-you-run-your-code/) with attribution).
- **Feature versions**: To pin to a specific version, append it to the Feature ID (e.g. from the [versions list](https://github.com/devcontainers/features/pkgs/container/features/go/versions)). The `:latest` tag is applied implicitly if omitted. ([Features – containers.dev](https://containers.dev/implementors/features/).)
- **Rebuild after changes**: After changing the dev container configuration, rebuild so tools pick up changes (e.g. "Dev Containers: Rebuild Container" or "Codespaces: Rebuild Container" in the command palette, in VS Code or compatible editors such as Cursor). ([VS Code Dev Containers extension](https://devcontainers.github.io/supporting), [GitHub Codespaces](https://devcontainers.github.io/supporting).)
- **Lifecycle script order**: Creation scripts run in this order: `onCreateCommand` → `updateContentCommand` → `postCreateCommand`. If one fails, later scripts are not run. ([Dev Container metadata reference – Lifecycle scripts](https://containers.dev/implementors/json_reference/).)

When the spec or official docs do not state a recommendation, do not present it as a best practice; either omit it or phrase it as a suggestion with a clear citation.

**Optional / community guidance:** Community articles (e.g. [Daytona – Ultimate guide to dev containers](https://www.daytona.io/dotfiles/ultimate-guide-to-dev-containers)) suggest practices such as keeping images lightweight, caching dependencies, and using Docker Compose for multi-service setups. Use with attribution and prefer spec/official docs when they conflict.

## Summary

- Use this skill when editing `devcontainer.json`, choosing Features/Templates, authoring Features, or answering questions about dev containers or containers.dev.
- Resolve questions via the canonical URLs above and the reference files under [references/](references/).
- Best practices: cite containers.dev or devcontainers.github.io; only include guidance that appears there. For OS-specific or troubleshooting issues, consult [VS Code Dev Containers Tips and Tricks](https://code.visualstudio.com/docs/devcontainers/tips-and-tricks) and [references/tips-and-tricks.md](references/tips-and-tricks.md).
Pliki w paczce (9)
  • SKILL.md 11 KB
  • evals/evals.json 5 KB
  • references/features.md 14 KB
  • references/schema.md 6 KB
  • references/spec.md 5 KB
  • references/templates.md 10 KB
  • references/tips-and-tricks.md 8 KB
  • references/tools.md 14 KB
  • references/vscode-containers.md 8 KB

Wersje

W bazie nie ma innych skilli o nazwie devcontainers-best-practices.

Migawka bazy z 13.11.2026 · wersja paczki edd050223a3d (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100devcontainers
    Tworzy, konfiguruje i diagnozuje devcontainery, pliki devcontainer.json i środowiska GitHub Codespaces: features, hooki cyklu życia, Docker Compose i walidacja.
  • 88dev-loop-dev-container
    Pomaga przygotować kontenery deweloperskie: plik devcontainer.json, Dev Containers w VS Code i Codespaces oraz powtarzalne środowiska pracy.
  • 95skill-148
    Pomaga tworzyć i konfigurować devcontainery w VS Code: pliki devcontainer.json, szablony, Docker i rozwiązywanie problemów.
  • 100devcontainers
    Pomaga budować, zmieniać i publikować Dev Containers: devcontainer.json, features, Dockerfile, szablony, publikację w GHCR, CLI devcontainer i diagnozę błędów uruchamiania kontenera.
  • 100aspire
    Konfiguruje dev containery dla projektów .NET Aspire: workload Aspire, Docker-in-Docker, przekierowanie portu dashboardu i orkiestracja wielu usług w Codespaces.
  • 87devcontainer
    Tworzy lub aktualizuje konfigurację VS Code Dev Containers dla projektów Python i Java pod Podmanem, z nazwą kontenera i użytkownikiem vscode.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.