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

Support push/pull images from Kaniko image builder #24

Closed
omusaev opened this issue Nov 8, 2019 · 9 comments
Closed

Support push/pull images from Kaniko image builder #24

omusaev opened this issue Nov 8, 2019 · 9 comments

Comments

@omusaev
Copy link

omusaev commented Nov 8, 2019

I have successfully installed trow on my kube cluster, built an image externally and pushed it to the registry. But when I try to pull it from the registry (I'm using kaniko to build images inside the cluster) I get this error:

Downloading base image trow.kube-public/blablabla
error building image: unsupported MediaType: "application/vnd.docker.distribution.manifest.v1+json", see google/go-containerregistry#377

@amouat
Copy link
Contributor

amouat commented Nov 9, 2019

Thanks Oleg. Could you share the image you're pushing/pulling?

I suspect Trow is failing to parse the manifest as v2 for some reason.

@amouat
Copy link
Contributor

amouat commented Nov 11, 2019

Just to clarify, I suspect what's happening is Trow is being sent a v2 manifest but is rejecting it for some reason and falling back to v1. I can't fix this issue with an example image or manifest.

@omusaev
Copy link
Author

omusaev commented Nov 11, 2019

Sorry for the delay.
A few more details:

  • I tried pushing and pulling the same image from the official registry image (https://hub.docker.com/_/registry). Works fine.
  • I'm using kaniko to build images based on images from the registry, so the error is from kaniko, but I think it doesn't really matter because it's getting the v1 manifest for some reason
  • here are a few screenshots (not sure if it helps, though :) ):
    push from outside the cluster
    image
    docker version
    image
    kaniko log (inside the cluster)
    image

Thanks!

@amouat
Copy link
Contributor

amouat commented Nov 11, 2019

So the base image being pulled by kaniko in the last log is the same image you pushed in the first step (the greyed out text is identical)?

Interesting. I think I'll have to test with kaniko to find this.

@omusaev
Copy link
Author

omusaev commented Nov 11, 2019

Yes, it was the same image, sorry for the grey areas :)

@omusaev
Copy link
Author

omusaev commented Nov 13, 2019

New info:
I have deployed helm chart for docker registry (https://github.com/helm/charts/tree/master/stable/docker-registry) and configured the certs manually. Everything works fine (same image, same kaniko build, etc.).

So, without deep researching, I would say that something wrong with the registry trow uses :)

@amouat
Copy link
Contributor

amouat commented Nov 13, 2019

Trow is a registry :)

And I'm pretty sure it is a bug in Trow. I think it's failing to parse the image manifest and falling back to v1.

To help me debug this it would be great if you could share an image that causes the error.

@amouat
Copy link
Contributor

amouat commented Dec 19, 2019

I'm going to rename this issue as after looking at the image and playing with Kaniko, it seems the main problem is that Trow doesn't respond in the expected way to some API call by kaniko. I'm not convinced there is a v1/v2 manifest problem (although that might also be a problem).

@amouat amouat changed the title unsupported MediaType: "application/vnd.docker.distribution.manifest.v1+json" Support push/pull images from Kaniko image builder Dec 19, 2019
@amouat amouat closed this as completed in 2902636 Jan 9, 2020
@amouat
Copy link
Contributor

amouat commented Jan 9, 2020

So, this was a weird one.

Kaniko behaves a bit strangely with pushes (the http logs don't make a lot of sense to me), and this has exposed a bug in some of Trow's underlying libraries. It seems Rocket ships with an old version of hyper, which under certain circumstances will cut off transfers. The mitigation is to turn off keep-alive, which I've done on master. Long-term this will be fixed when Rocket upgrades the version of hyper, or Trow moves to a different framework.

The code in master should now work correctly for kaniko and shortly the Docker Hub containersol/trow:default and latest images will contain the fix.

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