-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multi-arch OCI image indexes in Bazel builder #9217
Comments
I'm giving it a try in #9219. I managed to make it load the
It appears to be due to the fact that the Docker Engine API expects a very specific format for the tarball: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageLoad |
This would be really useful. Looks like Docker Engine doesn't support OCI-format multi-arch tarballs out of the box, rules_oci doesn't produce Docker-format multi-arch tarballs, and skaffold doesn't currently support alternative container APIs like containerd. (https://github.com/GoogleContainerTools/skaffold/blob/main/pkg/skaffold/docker/image.go would need to be generalized). Might need a new bazel rule something like docker_tarball to make tarballs in the format docker API expects, or generalize skaffold to be able to communicate with a containerd |
I am working in a Bazel workspace that uses
rules_oci
to build image tarballs, and Skaffold to perform the build+deploy steps.As I'm working on an M1 (and minikube) but deploying on a remote k8s cluster based on
linux-amd64
, the images I'm building are multi-arch.When running
skaffold dev
, it fails with the following error:Here is an excerpt of the
BUILD.bazel
file, note howformat = "oci"
inoci_tarball
:BUILD.bazel
This is happening due to the following section:
skaffold/pkg/skaffold/build/bazel/build.go
Lines 93 to 96 in 1255d6c
tarball.LoadManifest
looks for themanifest.json
file in the tarball built by Bazel, but won't find it since OCI image indexes use anindex.json
file instead: https://github.com/google/go-containerregistry/blob/4fdaa32ee934cd178b6eb41b3096419a52ef426a/pkg/v1/tarball/image.go#L74-L79go-containerregistry
already exposes a package to load theindex.json
file:layout.ImageIndexFromPath
RepoTags
can be deducted using the stategy explained here: opencontainers/image-spec#796The text was updated successfully, but these errors were encountered: