Skip to content

fix(devcontainer): the image holds the locked tools in standard locations #4359

Closed

Description

@dan-petty

Problem

In the devcontainer, devops roadmap plan-check <n> fails with Required dependency 'openspec' is not installed or not available in PATH.

Post-create installs the locked tools into ~/.local/bin, which is not on PATH. Post-create also installs files at each container creation, so a tool is not part of the image.

Expected

The devcontainer image holds every tool of tools.lock at its locked version, in standard locations: commands in /usr/local/bin, which is on PATH, and the files of a Python or Node tool in /usr/local/share/devops-cli. Post-create installs no locked tool. A rebuild of the image changes a tool.

Evidence

  • devops roadmap plan-check 4351 in the devcontainer prints the error above.
  • ~/.local/bin/openspec exists after post-create, and ~/.local/bin is not in $PATH.

Proposed design

Problem statement

In the devcontainer, devops roadmap plan-check <n> fails because openspec is not on PATH. Post-create installs the locked tools into ~/.local/bin, and that directory is not on PATH. Post-create also installs the tools at each container creation, so the image does not hold them. A rebuild of the image does not change a tool.

Acceptance criteria

Requirement: Commands in a standard location

The devcontainer image SHALL hold the command of every tool of tools.lock in /usr/local/bin.

Scenario: Command on PATH

  • WHEN a test reads the Dockerfile and the install step of the image for each tool of tools.lock
  • THEN the test finds the command installed in /usr/local/bin, and no command in ~/.local/bin

Requirement: Tool files in a standard location

The devcontainer image SHALL hold the files of each Python or Node tool in /usr/local/share/devops-cli.

Scenario: Files of a Python or Node tool

  • WHEN a test reads the install step of the image for a Python tool and a Node tool
  • THEN the test finds the tool files under /usr/local/share/devops-cli and a command in /usr/local/bin that starts the tool

Requirement: Locked versions in the image

The image build SHALL install each tool at the version and the checksum that tools.lock states.

Scenario: Version of a tool

  • WHEN a test compares the version of each tool in the install step with tools.lock
  • THEN every tool has the locked version, and a tool with no locked version fails the test

Requirement: No locked tool in post-create

Post-create MUST NOT install a tool of tools.lock.

Scenario: Post-create command

  • WHEN a test reads the post-create command of .devcontainer/devcontainer.json
  • THEN the command runs no install of a locked tool and does not write to ~/.local/bin

Requirement: Rebuild changes a tool

A change of a locked version SHALL change the layer of the image that installs that tool.

Scenario: Changed lock entry

  • WHEN a test changes the locked version of one tool and reads the Dockerfile build input
  • THEN the install layer of that tool takes the new version from the lock, so a rebuild installs it

Requirement: Commands resolve without a local path

The CI actions that build and smoke-test the devcontainer image MUST NOT need $HOME/.local/bin on PATH to find a locked tool.

Scenario: Smoke test of the image

  • WHEN a test reads .github/actions/devcontainer-image/action.yml and .github/actions/devcontainer-smoke/action.yml
  • THEN neither action exports $HOME/.local/bin to find a locked tool, and the smoke step runs openspec --version from PATH

Existing Tool Considered

No open tool installs the locked tools of this project with its checksums into an image layer. The project already has its own install code (devops install-tools) that reads tools.lock. The plan reuses that code at image build time with a system prefix, so it adds little new code. The cost is a small change of the Dockerfile and the install code, about one pull request, and a few hours of elapsed time. No check of alternatives has run.

Key questions

  • Which Dockerfile step installs the locked tools?: Run the existing locked-tool installer in a Dockerfile layer, with /usr/local/bin as the command directory and /usr/local/share/devops-cli as the tool file directory. Pass the lock file into the layer, so that a change of the lock invalidates the layer. (best practice) [sources: tests/commands/test_install_tools.py, docs/adr/0005-review-findings-come-from-tools-not-models.md]
    • Chosen: Run the project installer in the Dockerfile with a system prefix. It reuses the lock, the checksums and the tests of the project, and the lock change rebuilds the layer.
    • Rejected: Add a ~/.local/bin entry to PATH. It leaves the tools out of the image and keeps the install at each container creation, which the issue rejects.
    • Rejected: Write a separate shell install step for each tool in the Dockerfile. It duplicates the versions and the checksums of the lock, and the two copies can differ.
  • Which files does the change touch besides the Dockerfile?: The change touches .devcontainer/devcontainer.json for post-create, the two CI actions that export $HOME/.local/bin, and the tests of the devcontainer. [sources: .devcontainer/devcontainer.json, .github/actions/devcontainer-image/action.yml, .github/actions/devcontainer-smoke/action.yml, tests/invariants/test_devcontainer_config.py, tests/commands/test_devcontainer.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/devcontainer
    status/new
    value/medium
    effort/medium
    on Nov 10, 2026
  2. dan-petty commented on Nov 10, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/devcontainer. The (devcontainer) scope of the title gives the scope.
    • Priority: P2-Medium. A command fails in the devcontainer, blocking a workflow, but a manual PATH fix is a workaround.
    • Value: Medium. Developers cannot run plan-check in the devcontainer until the fix lands.
    • Effort: Medium. Requires Dockerfile changes, post-create script edits, and verification of standard install paths.
    • Related: DevContainer Post-Create Automatically Bootstraps Missing DevOps Tools #620, which asks for a different change. Both deal with tools in the devcontainer, but #620 adds post-create bootstrapping while the candidate removes post-create installs and puts tools in the image at build time.
  3. added
    priority/p2-medium
    on Nov 10, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 10, 2026
  5. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 273e4c9 (see proposed design in issue body).

  6. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 10, 2026
  7. removed
    status/in-review
    on Nov 10, 2026
  8. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    Contributor
  9. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-10 16:07 UTC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/devcontainersource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions