Skip to content

up --frozen-lockfile doesn't fail when lockfile is outdated #1273

Closed

Description

npx @devcontainers/cli up --help says:

  --frozen-lockfile                 Ensure lockfile exists and remains unchanged;
                                     fail otherwise.   [boolean] [default: false]

I just ran up --frozen-lockfile twice, changing devcontainer.json (Really simple - image and feature. Changed feature from one to another.) in between without updating the lockfile. Got success and the same container id both times.

Activity

  1. v-Kaniska244 commented on Sep 28, 2026

    @v-Kaniska244
    Contributor

    Hi Andreas Opferkuch (@s-h-a-d-o-w)

    Thank you for reporting this issue. The --frozen-lockfile option was introduced as part of this PR.
    In case if this flag is set to true in the devcontainer up command and feature configuration changed in devcontainer.json, the up command will fail with an error Error: Lockfile does not match similar to the below.

    @v-Kaniska244 ➜ /workspaces/images (universal-image-size-check) $ devcontainer up --id-label "test-container=sample-image" --workspace-folder "./src/sample-image/" --frozen-lockfile true
    [2 ms] @devcontainers/cli 0.89.0. Node.js v22.17.0. linux 6.8.0-1064-azure x64.
    [677 ms] Resolving Feature dependencies for 'ghcr.io/devcontainers/features/node:2'...
    [1650 ms] Soft-dependency 'ghcr.io/devcontainers/features/common-utils' is not required.  Removing from installation order...
    [2206 ms] Files to omit: ''
    Error: Lockfile does not match.
        at sQ (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:287:50)
        at async fQ (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:394:2059)
        at async uI (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:397:2321)
        at async FQ (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:397:273)
        at async Sp (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:469:1947)
        at async LG (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:469:608)
        at async kW (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:488:4689)
        at async hI (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:488:5808)
        at async C9 (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:669:206)
        at async I9 (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:668:16607)
    {"outcome":"error","message":"Lockfile does not match.","description":"An error occurred setting up the container."}
    @v-Kaniska244 ➜ /workspaces/images (universal-image-size-check) $ 
    

    Kindly kill the container process and clean up the local image cache before running devcontainer upcommand with--frozen-lockfileoption astrue. You should be able to see the intended result. If the the image cache exists from the previous build, devcontainer upwill spin up the container if the image available in the local image cache by default irrespective of--frozen-lockfile` option.
    Please let me know in case of further concern regarding this issue.

  2. s-h-a-d-o-w commented on Sep 28, 2026

    @s-h-a-d-o-w
    Author

    Ah, I see! Yes, I suppose it makes sense that this would only happen when building the container. Thanks!

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

Metadata

Metadata

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