Skip to content
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

container_pull failed for images layers with MediaType "application/vnd.docker.image.rootfs.diff.tar" #2266

Open
HDYA opened this issue Aug 11, 2023 · 1 comment
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not

Comments

@HDYA
Copy link

HDYA commented Aug 11, 2023

🐞 bug report

Affected Rule

The issue is caused by the rule:
  • container_pull

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Not sure, we have tested v0.24.0 and v0.25.0 and both failed

Description

A clear and concise description of the problem...

we found that the rule container_pull seems to assume the MediaType of image layers is gzip, even when the actual MediaType is application/vnd.docker.image.rootfs.diff.tar

🔬 Minimal Reproduction

  1. prepare an image with MediaType application/vnd.docker.image.rootfs.diff.tar
  2. write the following configs in WORKSPACE
container_pull(
    name = "image_source",
    digest = "<IMAGE_DIGEST>",
    registry = "<IMAGE_REGISTRY>",
    repository = "<IMAGE_REPOSITORY>",
)
  1. write the following configs in ``
    container_image(
        name = "build_image",
        base = "@image_source//image",
        architecture = "amd64",
        visibility = ["//visibility:public"],
    )
  1. run bazelisk build //:build_image

🔥 Exception or Error





2023/08/11 18:56:25 Image pull was unsuccessful: unable to save remote image : unable to write image layers: unable to write image layer: unable to get the contents of layer 0: gzip: invalid header

🌍 Your Environment

Operating System:

  
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy
  

Output of bazel version:

  
Bazelisk version: v1.11.0
Build label: 6.3.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Aug 8 15:48:33 2023 (1691509713)
Build timestamp: 1691509713
Build timestamp as int: 1691509713
  

Rules_docker version:

  
v0.24.0 and v0.25.0
  

Anything else relevant?

Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not
Projects
None yet
Development

No branches or pull requests

1 participant