docker / docker/cli

docker service update --image no longer resolves tags to digests in v29

Open
#7,302 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug status/0-triage
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

docker service update --image no longer asks the registry to resolve the supplied image tag to a digest in Docker CLI v29.

When a service already stores a mutable image reference such as localhost:5000/test:latest, pushing new content to that tag and running docker service update --image localhost:5000/test:latest test leaves the service specification unchanged. No task is recreated, even though the registry now returns a different digest.

The command reports that the service has converged, but it continues running the previous image. This appears to be a Docker CLI regression rather than Swarm or registry behavior.

Actual result

The service image remains localhost:5000/test:latest. The tag is not resolved to its new digest. Because the resulting service specification is unchanged, Swarm does not create a new task.

Adding --force recreates the task, but the service is still not pinned to a digest and --force should not be required when the resolved digest changed.

Reproduce

The following example uses a single-node Swarm and a local registry.

docker swarm init

docker run -d --name registry --restart always -p 5000:5000 registry:2

docker pull alpine:3.20
docker tag alpine:3.20 localhost:5000/test:latest
docker push localhost:5000/test:latest

docker service create \
  --name test \
  --no-resolve-image \
  localhost:5000/test:latest \
  sleep 1d

docker pull alpine:3.21
docker tag alpine:3.21 localhost:5000/test:latest
docker push localhost:5000/test:latest

docker service update \
  --image localhost:5000/test:latest \
  test

docker service inspect \
  --format '{{.Spec.TaskTemplate.ContainerSpec.Image}}' \
  test

docker service ps --no-trunc test

The inspected image remains the bare tag and the existing task is not replaced.

Expected behavior

Unless --no-resolve-image is explicitly supplied, the CLI should query the registry and send an update containing localhost:5000/test:latest@sha256:<new-digest>. The changed digest should cause Swarm to roll out a new task.

docker version
Client:
 Version:           29.1.3
 API version:       1.52
 OS/Arch:           linux/amd64

Server:
 Engine:
  Version:          29.1.3
  API version:      1.52
  OS/Arch:          linux/amd64
docker info
Server Version: 29.1.3
OSType: linux
Architecture: x86_64
Swarm: active
 Is Manager: true

Internal registry, node, and network details have been omitted.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the single-node Swarm and local registry reproduction using docker service update --image, then trace the Docker CLI service-update entry point. Compare behavior with and without --no-resolve-image; done means the default path sends the refreshed tag with its new digest and Swarm replaces the task, while the explicit flag preserves the tag.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.