colima icon indicating copy to clipboard operation
colima copied to clipboard

Metadata.LastTagTime not set correctly - new compose pull_policy settings (weekly, every_...) do not work as intended

Open AndreasA opened this issue 6 months ago • 1 comments

Description

Docker compose has a new pull_policy setting that allows one to e.g. try a refresh/pull once per week, instead of always or missing or similar.

See: https://github.com/docker/compose/issues/12563 and https://docs.docker.com/reference/compose-file/services/#pull_policy and https://docs.docker.com/compose/releases/release-notes/#bug-fixes-and-enhancements-3

However, that feature depends on Metadata.LastTagTime setting as is also mentioned in the comment of the issue https://github.com/docker/compose/issues/12563#issuecomment-2674124607

I have tries this with a freshly installed colima and it always returns "0001-01-01 00:00:00 UTC" instead of the last docker image pull or check if pull needed date.

I tried the same with a freshly installed Docker Desktop and there it is set correctly. every time I do a docker image pull, even if there is no updated Metadata.LastTagTime is refreshed.

Without setting this correctly, pull_policy: weekly or similar basically behaves like pull policy always which is not what I want it to.

Version

Colima: 0.8.1 Using virtiofs und vz Latest macOS 15.x

Operating System

  • [ ] macOS Intel <= 13 (Ventura)
  • [ ] macOS Intel >= 14 (Sonoma)
  • [ ] Apple Silicon <= 13 (Ventura)
  • [x] Apple Silicon >= 14 (Sonoma)
  • [ ] Linux

Output of colima status

No response

Reproduction Steps

See that one comment, instead of

$ docker image inspect alpine -f '{{ .Metadata.LastTagTime }}'
2025-02-21 09:45:10.235550419 +0000 UTC
$ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
Digest: sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c
Status: Image is up to date for alpine:latest
docker.io/library/alpine:latest
$ docker image inspect alpine -f '{{ .Metadata.LastTagTime }}'
2025-02-21 10:07:22.382362425 +0000 UTC

the inspect commands will always produce "0001-01-01 00:00:00 UTC"

Expected behaviour

this should work and the pull policy should work correctly

$ docker image inspect alpine -f '{{ .Metadata.LastTagTime }}'
2025-02-21 09:45:10.235550419 +0000 UTC
$ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
Digest: sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c
Status: Image is up to date for alpine:latest
docker.io/library/alpine:latest
$ docker image inspect alpine -f '{{ .Metadata.LastTagTime }}'
2025-02-21 10:07:22.382362425 +0000 UTC

Additional context

No response

AndreasA avatar May 09 '25 06:05 AndreasA