Skip to content

[24.0 backport] fix: docker pull with platform checks wrong image tag#45562

Merged
thaJeztah merged 1 commit intomoby:24.0from
laurazard:fix-pull-platform-backport
May 18, 2023
Merged

[24.0 backport] fix: docker pull with platform checks wrong image tag#45562
thaJeztah merged 1 commit intomoby:24.0from
laurazard:fix-pull-platform-backport

Conversation

@laurazard
Copy link
Member

@laurazard laurazard commented May 18, 2023

This fixes a bug where, if a user pulls an image with a tag != `latest` and
a specific platform, we return an NotFound error for the wrong (`latest`) tag.
see: moby#45558

This bug was introduced in moby@779a5b3
in the changes to `daemon/images/image_pull.go`, when we started returning the error from the call to
`GetImage` after the pull. We do this call, if pulling with a specified platform, to check if the platform
of the pulled image matches the requested platform (for cases with single-arch images).
However, when we call `GetImage` we're not passing the image tag, only name, so `GetImage` assumes `latest`
which breaks when the user has requested a different tag, since there might not be such an image in the store.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
(cherry picked from commit f450ea6)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
@laurazard laurazard requested review from rumpl, thaJeztah and vvoland May 18, 2023 12:42
@laurazard laurazard added status/2-code-review area/images Image Distribution kind/bugfix PR's that fix bugs labels May 18, 2023
@thaJeztah thaJeztah added this to the 24.0.1 milestone May 18, 2023
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
Copy link
Member

image-bin failure can be ignored

@thaJeztah thaJeztah merged commit 821e4ec into moby:24.0 May 18, 2023
natalieparellano pushed a commit to buildpacks/lifecycle that referenced this pull request Jun 7, 2023
pack acceptance is failing because `docker pull` is checking for the presence
of buildpacksio/lifecycle:latest instead of the commit tag that we used

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/images Image Distribution kind/bugfix PR's that fix bugs status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants