I am trying to run a docker container on a minikube virtual machine, but I'm having trouble accessing the container.
Outside of minikube, I run container like so
docker run -d --rm -p 6717:6717 <image-name>
So, I'm mapping port 6717 of my host machine to port 6717 of the machine where docker is running.
And I would usually use http://locahost:6717
to send requests to the application running inside the container (which is a Fast API application, but I don't think that matters that much).
While using minikube, however, I can't seem to access the container.
I checked out this post: Unable to connect to running docker containers (minikube docker daemon).
The person seemed to have the issue issue that I had, but the suggested solution doesn't really solve my problem. In other words, instead of using localhost, I used the minikube VM's IP address like this
> minikube ip
Then tried to send requests to http://<minikube-ip>:6717
. However, this also doesn't work.
I ssh'd into the VM like this:
> minikube ssh
and I can confirm that the application inside docker is running since I can do something like this successfully:
> curl http://localhost:6717
What am I missing exactly? I don't understand why I can't connect to the docker container using the minikube VM's IP address.