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

Failed to container_pull image with a v1 manifest #1253

Closed
mmikitka opened this issue Oct 28, 2019 · 1 comment
Closed

Failed to container_pull image with a v1 manifest #1253

mmikitka opened this issue Oct 28, 2019 · 1 comment

Comments

@mmikitka
Copy link
Contributor

Other than re-publishing v1-manifest image to my own repo, can you advise on how to support V1 manifest repos with container_pull?

I get the following error when I attempt to fetch the keycloak-gatekeeper image from quay.io and dockerhub.com:

bazel fetch @keycloak-gatekeeper//...
INFO: Call stack for the definition of repository 'keycloak-gatekeeper' which is a container_pull (rule definition at 
ERROR: An error occurred during the fetch of repository 'keycloak-gatekeeper':
   Pull command failed: 2019/10/28 19:09:37 Running the Image Puller to pull images from a Docker Registry...
2019/10/28 19:09:38 Image pull was unsuccessful: reading image "quay.io/keycloak/keycloak-gatekeeper@sha256:103d49ceaf9dab3d96757fb76732e2047051471deb4e8a459347aa17a9fe65d7": unsupported MediaType: "application/vnd.docker.distribution.manifest.v1+prettyjws", see https://github.com/google/go-containerregistry/issues/377
 
ERROR: Pull command failed: 2019/10/28 19:09:37 Running the Image Puller to pull images from a Docker Registry...
2019/10/28 19:09:38 Image pull was unsuccessful: reading image "quay.io/keycloak/keycloak-gatekeeper@sha256:103d49ceaf9dab3d96757fb76732e2047051471deb4e8a459347aa17a9fe65d7": unsupported MediaType: "application/vnd.docker.distribution.manifest.v1+prettyjws", see https://github.com/google/go-containerregistry/issues/377

I have the following in my WORKSPACE file:

http_archive(
    name = "io_bazel_rules_docker",
    sha256 = "14ac30773fdb393ddec90e158c9ec7ebb3f8a4fd533ec2abbfd8789ad81a284b",
    strip_prefix = "rules_docker-0.12.1",
    urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.12.1/rules_docker-v0.12.1.tar.gz"],
)
load(
    "@io_bazel_rules_docker//container:container.bzl",
    "container_pull",
)

load(
    "@io_bazel_rules_docker//repositories:repositories.bzl",
    container_repositories = "repositories",
)

container_repositories()

# Tag: 6.0.1
container_pull(
    name = "keycloak-gatekeeper",
    registry = "quay.io",
    repository = "keycloak/keycloak-gatekeeper",
    digest = "sha256:103d49ceaf9dab3d96757fb76732e2047051471deb4e8a459347aa17a9fe65d7",
)

Related content from https://github.com/google/go-containerregistry/

@alex1545
Copy link
Contributor

Hi @mmikitka,
You are probably referring to the inability to pull a manifest v2 schema 1 image and not a manifest v1 image. Unfortunately, we cannot provide you with a better workaround for your usecase and believe this issue shouldn't be addressed here for a few reasons:

  1. Image manifest v2, schema 1 is deprecated since manifest v2, schema 2 came out (reference).
  2. quay.io seems to be very behind with their migration to support manifest v2, schema 2 and they seem to still want to support schema 1 in order not to break existing users. This makes sense, but doesn't justify the need to continue publishing latest images using the schema 1 format.
  3. We recently migrated rules_docker to use google/go-containerregistry and are very happy with it. As you can see in the issue you referenced, they have their own good reasons why not to support schema 1.

Please reopen the issue if you feel there is a reason to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants