docs/current_docs/reference/cli/lockfiles.mdx
Lockfiles let Dagger remember the exact result of selected lookups, so later runs can either reuse that recorded result or intentionally refresh it.
There are two separate concepts:
Lock mode is set for a run, typically with --lock.
dagger --lock=pinned call ...
Available modes:
| Mode | Meaning |
|---|---|
disabled | Ignore the lockfile completely. |
live | Resolve everything live and record the result. |
pinned | Reuse pinned entries, resolve everything else live, and record the result. |
frozen | Resolve only from the lockfile and fail on misses. |
The easiest way to think about lock modes is:
disabled: feature offlive: refresh while runningpinned: prefer stable pins, refresh the restfrozen: require a complete lockfileTypical uses:
disabled: opt out for this runlive: bootstrap or intentionally refresh while running a workflowpinned: day-to-day development and most CIfrozen: reproducible, hermetic, or offline runsLock policy is stored on each lock entry.
Available policies:
| Policy | Meaning |
|---|---|
pin | Prefer the recorded value when the lock mode allows it. |
float | Prefer live resolution when the lock mode allows it. |
The easiest way to think about lock policies is:
pin: stay on this exact resolved resultfloat: keep following the live reference when possibleMode is chosen by the caller for the current run. Policy is remembered in the lockfile for each entry.
That means:
For example, if a lock entry has policy pin:
disabled ignores itlive resolves live and rewrites itpinned reuses itfrozen reuses itIf a lock entry has policy float:
disabled ignores itlive resolves live and rewrites itpinned resolves live and rewrites itfrozen reuses the recorded value as-isIf an entry is missing:
disabled resolves live and does not writelive resolves live and writespinned resolves live and writesfrozen failsUse dagger lock update when you want to rewrite lock entries on purpose.
dagger lock update
That refreshes entries already recorded in .dagger/lock using the current environment's normal ambient authentication.
To refresh or discover entries encountered by a specific command, run that command with --lock=live:
dagger --lock=live call release
dagger --lock=live query --doc query.graphql
It is your responsibility to run lock updates in an environment that can authenticate to any private registries or repositories those lookups require.
These operations currently record and resolve lock entries:
| Operation | Inputs | Default policy |
|---|---|---|
container.from | [imageRef, platform] | pin |
git.head | [remoteURL] | float |
git.branch | [remoteURL, branchName] | float |
git.tag | [remoteURL, tagName] | pin |
git.ref | [remoteURL, refName] | pin for tags, float otherwise |
git.commit is already pinned by its input and does not create lock entries.