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
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:
skaffold dev -p local --port-forward
Generating tags...
- api -> api:v0.31.1-6-g1781fcd-dirty
Checking cache...
- api: Not found. Building
Starting build...
Found [minikube] context, using local docker daemon.
Building [api]...
Target platforms: [linux/arm64]
Loading:
Loading:
Loading: 0 packages loaded
Analyzing: target //backend/apps/api:image.tar (0 packages loaded, 0 targets configured)
INFO: Analyzed target //backend/apps/api:image.tar (46 packages loaded, 1470 targets configured).
INFO: Found 1 target...
[5 / 16] [Prepa] BazelWorkspaceStatusAction stable-status.txt
Target //backend/apps/api:image.tar up-to-date:
bazel-bin/backend/apps/api/image.tar/tarball.tar
INFO: Elapsed time: 0.771s, Critical Path: 0.43s
INFO: 3 processes: 2 internal, 1 darwin-sandbox.
INFO: Build completed successfully, 3 total actions
Cleaning up...
- No resources found
Error: uninstall: Release not loaded: postgres: release: not found
Error: uninstall: Release not loaded: redis: release: not found
Error: uninstall: Release not loaded: jaeger: release: not found
Cleaning up resources encountered an error, will continue to clean up other resources.
build [api] failed: loading manifest from tarball failed: file manifest.json not found in tar
Here is an excerpt of the BUILD.bazel file, note how format = "oci" in oci_tarball:
I managed to make it load the index.json manifest, but performing the docker load operation locally is failing with the following error:
build [api] failed: loading image into docker daemon: reading from image load response: open /var/lib/docker/tmp/docker-import-3424243076/blobs/json: no such file or directory
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: