You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.
The --platform flag I added to the puller (#113) doesn't seem to work with some of the official images like busybox, since those manifests use platform variants for some architectures:
If you try to pull with --platform=linux/amd, it fails, presumably since the platform doesn't match fully.
$ bazel-bin/puller --name index.docker.io/library/busybox:latest --directory /tmp/busybox --platform=linux/armF1119 19:28:06.679466 74570 fast_puller_.py:128] Error pulling and saving image index.docker.io/library/busybox:latest: Could not resolve manifest list to compatible manifest
Docker's cli somehow handles this, apparently downloading the v7 variant, but I don't know how it does that.
I can think of a few ways to address this:
Remove --platform, replacing it with --os, --architecture, and --variant. It's most explicit, and perhaps is what I should have done all along, but technically is a breaking change. (I'm not sure if anyone is using --platform yet though, since it's pretty new.)
Emulate whatever the docker cli is doing, though I don't like this one as much, since it doesn't seem to be documented, and I can't figure out how to make it download e.g. the arm v5 variant image.
I feel like the best options are either 1 or 2a. Thoughts?
(Note that the place I intend to use this, bazelbuild/rules_docker#544, already separates out os and architecture, so I'll probably add a third attribute there, variant, or maybe even turn it into a dict.)
Looking at the OCI spec (and what is implemented in client/v2_2/docker_image_list_.py) we may also need to support os.features, os.version, and probably features too. (The golang image uses os.version for the windows images, for example.)
I'm not sure what the cleanest way to do this is. I don't think we can really add all of those fields to --platform in a manageable way, though.
@ixdy afaik rules_docker is the main user of this repo, so breaking changes (as long as we follow up with PR in rules_docker) should be fine. My preference is option 1.
@ixdy if you want one flag to fit all of this in, you could change --platform to accept a json blob and just pass that through to resolve, though for interactive use that is probably more cumbersome than --os and --architecture flags (et al).
The
--platform
flag I added to the puller (#113) doesn't seem to work with some of the official images like busybox, since those manifests use platform variants for some architectures:If you try to pull with
--platform=linux/amd
, it fails, presumably since the platform doesn't match fully.Docker's cli somehow handles this, apparently downloading the
v7
variant, but I don't know how it does that.I can think of a few ways to address this:
--platform
, replacing it with--os
,--architecture
, and--variant
. It's most explicit, and perhaps is what I should have done all along, but technically is a breaking change. (I'm not sure if anyone is using--platform
yet though, since it's pretty new.)--platform
to support variants somehow, eithera. with an optional
/variant
suffix (e.g.linux/arm/v7
), orb. by translating special values like those listed in https://github.com/docker-library/go-dockerlibrary/blob/master/architecture/oci-platform.go, e.g.
arm32v7
->{arm, v7}
I feel like the best options are either 1 or 2a. Thoughts?
(Note that the place I intend to use this, bazelbuild/rules_docker#544, already separates out
os
andarchitecture
, so I'll probably add a third attribute there,variant
, or maybe even turn it into a dict.)cc @KaylaNguyen @nlopezgi
The text was updated successfully, but these errors were encountered: