I am trying to push an image to a local registry running in minikube but get the below error:
Successfully built ee84225eb459 Successfully tagged user/apiserver:0.0.1 $ docker push localhost:5000/user/apiserver:0.0.1 The push refers to a repository [localhost:5000/user/apiserver] An image does not exist locally with the tag: localhost:5000/user/apiserver
I have already tried starting minikube with below:
minikube start --vm-driver xhyve --insecure-registry localhost:5000 eval $(minikube docker-env)
To push an image to Docker Hub, you must first name your local image using your Docker Hub username and the repository name that you created through Docker Hub on the web. You can add multiple images to a repository by adding a specific :<tag> to them (for example docs/base:testing ).
A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters.
Use docker image push to share your images to the Docker Hub registry or to a self-hosted one. Refer to the docker image tag reference for more information about valid image and tag names.
You need to tag and push the image. When tagging an image, you can use the image identifier (imageId). It is listed when showing the list of all images with docker images. Syntax and an example (using imageId) for creating a tag are:
docker tag <imageId or imageName> <hostname>:<repository-port>/<image>:<tag> docker tag af340544ed62 example.com:18444/hello-world:mytag
Once the tag, which can be equivalent to a version, is created successfully, you can confirm its creation with docker images and issue the push with the syntax:
docker push <hostname>:<repository-port>/<image>:<tag>
There is an example for local nexus repository
Successfully tagged user/apiserver:0.0.1 docker push localhost:5000/user/apiserver:0.0.1
Image tags need to include the registry name/port for you to push them anywhere other than the default registry (docker hub). So you need to tag your image as localhost:5000/user/apiserver:0.0.1
rather than user/apiserver:0.0.1
. Then you'll be able to push to your local registry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With