How to access `docker-compose` containers, in Minikube

Viewed 1818

Issue:

I want my web-server to have either a Kubernetes config and a Docker-Compose config.

I run them on a MacBook (no native containers support), so at the moment I

  • run docker-compose on Docker Desktop
  • run kubectl on a Minikube VM
    (I stick to Minikube because of the convenient commands likeĀ minikube ip & minikube service, that I rely on in my scripts)

This makes slow and inconvenient to switch from one setup to the other (suspend Minikube, start Docker Desktop, rebuild the images, re-run the services; and vice-versa).
They won't share built images or containers, and they run in different environments.


Attempt

I tried running docker-compose on Docker from the Minikube VM.
Works fine, but I cannot connect to the service, because there is no tunnelling or port-forwarding from the Host machine to the Minikube machine
(while compose takes care of the inner forwarding from $(minikube ip):8081 to docker-container-webserver:8080.

Question

How to open the connection from the Host machine (browser) to the container (web-server) running inside Minikube?

I tried minikube tunnel but it didn't seem to help (it is designed to work with Kubernetes LoadBalancer services).

0 Answers
Related