Skip to content

Conversation

@tennisleng
Copy link

Summary

This proposal addresses Issue #671 - making it easier to reuse local Features in dev containers.

Problem

Users who want to manage a collection of their own dev container configurations and Features in a single repository face significant friction. The current specification requires local Features to be stored within the .devcontainer/ folder at the project workspace folder root, which makes reusing Features across different dev container configurations difficult.

Solution

This PR introduces a new localFeaturesRoot property for devcontainer.json that allows users to specify a custom base directory for resolving local Feature paths.

Property Definition

Property Type Description
localFeaturesRoot string Path (relative to the folder containing devcontainer.json) that serves as the base for resolving local Feature paths. Defaults to . (current behavior).

Example Usage

{
    "name": "My Project",
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "localFeaturesRoot": "../../shared-features",
    "features": {
        "./my-feature": {}  // Resolves to shared-features/my-feature
    }
}

Changes Made

  1. proposals/flexible-local-feature-paths.md - New proposal document with full specification
  2. docs/specs/devcontainerjson-reference.md - Added localFeaturesRoot property to the reference
  3. docs/specs/devcontainer-features-distribution.md - Updated "Locally referenced Features" section with new property documentation and examples
  4. schemas/devContainer.base.schema.json - Added localFeaturesRoot property to the JSON schema

Backward Compatibility

This change is fully backward compatible:

  • The localFeaturesRoot property is optional
  • When not specified, behavior is identical to current spec
  • Existing configurations continue to work without modification

Implementation Notes

This is a specification-only proposal. The actual implementation would need to be done in the devcontainers/cli repository.


Fixes #671

Addresses devcontainers#671 - making it easier to reuse local features in dev containers.

This proposal introduces a new `localFeaturesRoot` property for `devcontainer.json`
that allows users to specify a custom base directory for resolving local Feature
paths, enabling Feature reuse across multiple dev container configurations.

Changes:
- Add proposal document: proposals/flexible-local-feature-paths.md
- Update devcontainer.json reference with localFeaturesRoot property
- Update Features distribution spec with expanded local feature docs
- Update JSON schema with localFeaturesRoot property definition
@tennisleng tennisleng requested a review from a team as a code owner December 14, 2025 00:27
@tennisleng
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider making it easier to reuse local features

1 participant