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

Please add a flag to avoid adding this "localhost/" prefix when tagging development images #24993

Open
sebastian-philipp opened this issue Jan 10, 2025 · 7 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@sebastian-philipp
Copy link

sebastian-philipp commented Jan 10, 2025

Feature request description

Hi there,

I'm coming from podman-desktop/extension-minikube#347

Essentially, I cannot make use of the local development image tagged by podman (MacOS + podman-desktiop + minkube):

  • I can't push the image to minikube, as minikube load fails with: unable to calculate manifest: Error response from daemon: docker.io/localhost/controller:latest
  • Even if I manage to push the image, then I'm getting an ImageInspectError: Failed to inspect image "controller:latest"

It seems as if the idea of adding a localhost/ prefix to development images is a good idea in theory, but neither minikube nor cri-o can handle this properly.

Please give me a way to avoid this and let me just use the image tag I specify without modifying it.

Thank you.

@sebastian-philipp sebastian-philipp added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 10, 2025
@afbjorklund
Copy link
Contributor

Here is the code in Kubernetes, that adds the default registry:

https://github.com/kubernetes/kubernetes/blob/master/pkg/util/parsers/parsers.go

It uses the docker registry ("distribution") code, to "normalize":

https://github.com/distribution/reference/blob/main/normalize.go

@afbjorklund
Copy link
Contributor

As a party trick, you can see what podman itself thinks about it:

podman pull localhost/myimage

Error: initializing source docker://localhost/myimage:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp 127.0.0.1:443: connect: connection refused

If you want a real local registry, you could use e.g. localhost:5000

https://distribution.github.io/distribution/ (registry v2)

https://github.com/opencontainers/distribution-spec

@sebastian-pf9
Copy link

Right this whole thing doesn't work. I ended up using a fake name (e.g. podman build -t docker.io/something/image:latest) on docker.io just to get it working for me.

@afbjorklund
Copy link
Contributor

BTW. Note that the only reason that localhost:5000 "works", is that a http proxy is being deployed:

https://minikube.sigs.k8s.io/docs/handbook/pushing/#4-pushing-to-an-in-cluster-using-registry-addon

kubernetes/cluster/addons/registry/README.md (it was abandoned and removed in 2018 / k8s 1.10)

The main reason to not deploy a real https registry, is because then you have to do certs and stuff...

@afbjorklund
Copy link
Contributor

I ended up using a fake name (e.g. podman build -t docker.io/something/image:latest) on docker.io

If it makes you feel better you can use quay.io here instead (like using Containerfile for your Dockerfile)

@allanrogerr
Copy link

Please fix. It would be convenient not to have to rename everything.

@sebastian-philipp
Copy link
Author

For me, this problem went away after a few days into the project after we had a proper name for the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants