Skip to content

[EPIC] Prefer DRY tool versioning #1699

Description

@fulldecent

The examples in this repository often show a configuration approach where tool version numbers are explicitly specified in the devcontainer.json file.

However, best practice nowadays is to extract your tool versions to a dedicated file.

We should support this best practice in our examples by showing how to indirectly reference to versions.

Examples of thing to change

```json
"features": {
"ghcr.io/devcontainers/features/node:2": {
"version": "20",
"npmVersion": "10.8.0"
}
}

"features": {
"ghcr.io/devcontainers/features/ruby:2": {}
}

Example end state

"features": {
    "ghcr.io/devcontainers/features/node:2": {
        "version": ".nvmrc"
    }
}
"features": {
    "ghcr.io/devcontainers/features/ruby:2": {
        "version": ".ruby-version"
    }
}

Discussion

Adopting the above approach allows us to achieve DRY version specification with modern development approaches. This means we can easily achieve parity between local developers, GitHub Agents, GitHub Actions, and Dev Containers :nirvana_emoji:

It is possible that the above features I have referenced already implicitly load such a version file. If so, this behavior is undocumented.

I am marking this GitHub issue as an "epic" because it affects many different features. And perhaps we will require several pull requests to address this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions