Skip to content

Make 'dagger update' actually update #13464

Closed

Description

@dagger-codex

Problem

dagger update doesn't actually update dependencies. It refreshes pins for moving targets, but it can't move a dependency from one release tag to the next.

Discord thread: dagger update does not update dagger dependencies

I would then expect that the dagger.json manifest would be updated to point to v0.3.0
but it remains at v0.2.0.

dagger update doesn't do semver updating

The same gap exists for container images and Git repos used by core APIs: container.from(address: "alpine") means alpine:latest — there's no pinned "latest release" for dagger update to advance.

Solution: treat "latest release" as a pinned dependency

Give "use the latest release" package-manager semantics, on a single lifecycle:

run behavior
first run select a release, record it in the lockfile
normal run reuse the recorded release
dagger update re-select and advance the pin
frozen run replay the pin; never hit the remote

Selection is one algorithm, shared by containers and Git:

  1. List the remote's tags.
  2. Pick the greatest semver tag (accept 1.2.3 and v1.2.3).
  3. Exclude prereleases unless subreleases are explicitly requested.
  4. No release tag? Fall back — container: the literal latest tag; Git: remote HEAD.
  5. Resolve to a digest/commit and pin the full reference.

So container.from(address: "alpine") resolves to docker.io/library/alpine:3.22.0@sha256:abc..., and a later dagger update bumps the lockfile to docker.io/library/alpine:3.23.0@sha256:def....

The lock modes map to the lifecycle: pinned reuses existing latest-release pins, frozen requires them and never lists remote tags/refs, and dagger update refreshes them.

Container

Whether latest-release applies depends on what the address already specifies — parse it before adding any implicit :latest:

address resolves to
alpine latest release (the algorithm above)
alpine:latest literal latest tag
alpine:3.20 literal 3.20 tag
alpine@sha256:... the digest

A tag or digest in the address keeps today's exact behavior. Only a bare address triggers latest-release.

Failure handling: if tag listing fails or is unsupported, fail clearly — don't fall back to latest unless listing succeeded and found no release tag. If the literal latest tag is also missing, fail clearly. latestIncludeSubreleases: true on a tagged or digested address is a validation error.

Git

Latest-release always applies (there's no address to parse). The only delta from the shared algorithm: the fallback when no release tag exists is remote HEAD rather than a latest tag.

Schema

extend type Container {
  """
  Download a container image.

  If address includes a tag or digest, use that exact reference.

  If address has no tag or digest, use the latest release tag. If no release
  tag exists, fall back to the literal "latest" tag.

  This operation is pinned.
  """
  from(
    address: String!
    latestIncludeSubreleases: Boolean = false
    # ...
  ): Container!
}

extend type GitRepository {
  """
  Return the latest release tag. If no release tag exists, fall back to the
  remote HEAD branch.

  This operation is pinned.
  """
  latest(includeSubreleases: Boolean = false): GitRef!
}

Lockfile

["","container.from",["docker.io/library/alpine","linux/amd64","latest-release",false],"docker.io/library/alpine:3.22.0@sha256:abc...","pin"]
["","git.latest",["https://github.com/dagger/dagger.git",false],"refs/tags/v0.21.4@0123456789abcdef0123456789abcdef01234567","pin"]

The container value must carry both tag and digest; the Git value must carry both ref and commit.

Implementation notes

  • Engine-side behavior; SDKs only expose the generated API.
  • Container tag listing uses the OCI/Docker registry endpoint GET /v2/<name>/tags/list.
  • container.from currently applies reference.TagNameOnly — latest-release must branch before that, and store tag+digest instead of digest-only.
  • GitRepository.latest reuses the existing Git lock/update machinery.

Activity

  1. added this to the v1.0.0 milestone on Jul 15, 2026
  2. marcosnils commented on Jul 15, 2026

    @marcosnils
    Contributor
  3. self-assigned this
    on Jul 21, 2026
  4. tiborvass commented on Aug 28, 2026

    @tiborvass
    Contributor

    Fixed by #13754

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions