-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Minikube registry instructions don't work on macOS #19813
Comments
Just had the same issue. A small difference though, I use minikube with the docker driver, so in this case the registry uses another port, as noted at minikube start:
Now, for me at least, when minikube starts up, the port mapping 51132:5000 will be automatically created, so I can use `curl http://localhost:51132/v2/" to get an empty json, as expected. However, this still doesn't work with docker push, and the reason I found behind that is that it tries to use IPv6. I used this socat command to get around that:
(Note the TCP6 listen) And then I could use |
@gabor-farkas thanks for your comment. The thing that really fixed it for me was step 1 and 2 below. From the docs, I was just using the subnet that was provided - when switching it to the minikube subnet, and the small modification to the socat step, I got it running via these steps:
minikube start -n 2 --insecure-registry "192.168.49.0/24"
minikube addons enable registry
docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:56866,reuseaddr,fork TCP:$(minikube ip):5000"
docker tag nginx:latest localhost:56866/nginx:onminikube
docker push localhost:56866/nginx:onminikube
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
nodeName: minikube
containers:
- image: 192.168.49.2:5000/nginx:onminikube
name: nginx
---
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx-m02
name: nginx-m02
spec:
nodeName: minikube-m02
containers:
- image: 192.168.49.2:5000/nginx:onminikube
name: nginx-m02 |
What Happened?
Following the docker on macOS instructions exactly for setting up a registry with minikube does not work. When trying to run
docker push
with my newly tagged image, I always encounterGet "http://localhost:5000/v2/": EOF
.Here are the steps I run (after
minikube delete
):minikube start --cni='cilium' --memory='no-limit' --cpus='no-limit' --nodes=2 --insecure-registry "10.0.0.0/24"
minikube addons enable registry
docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip):5000"
docker tag <my image>:latest localhost:5000/my_image
,docker push localhost:5000/my_image
Get "http://localhost:5000/v2/": EOF
2024/10/16 22:57:07 socat[11] E connect(5, AF=2 192.168.49.2:5000, 16): Connection refused
where192.168.49.2
is the minikube ip.The only way I've been able to push any image to any registry is to manually start the registry on a node:
minikube ssh
docker run --restart=always -d -p 5000:5000 --name registry registry:2
docker ps -a
that the new container exists with ports0.0.0.0:5000->5000/tcp, :::5000->5000/tcp
docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip):5000"
docker push localhost:5000/my_image
Maybe obviously, though, that image will only be available on my control-plane node and not the other one.
Attach the log file
log.txt
Operating System
macOS (Default) arm64
Driver
Docker
The text was updated successfully, but these errors were encountered: