php - Remote docker http request

one text

I have 2 computers running on the same network as following

Macbook Pro M1 (Monterey)

  • Acts as Client (Guest)
  • Docker version 20.10.12, build e91ed57
  • Docker Compose version v2.2.3

Lenovo (Ubuntu 21.04)

  • Local IP: 192.168.0.63
  • Acts like Host (host all my docker containers)
  • Docker version 20.10.7, build 20.10.7-0ubuntu5~21.04.2
  • docker-compose version 1.29.2, build 5becea4c

Because docker is super slow on Mac, and i am a Mac guy, i wanted to host my containers on Ubuntu and make all development and the http api request from Mac.

So on Ubuntu: i setup all my docker containers And on Mac: i set: export DOCKER_HOST=192.168.0.63

When i run on my Mac:

  • docker ps : I can successfully list the the container from Ubuntu.
  • docker context ls : I get Current DOCKER_HOST based configuration tcp://192.168.0.63:2375

But when i try to make http request e.g http://ucp.mydomain.localhost/api/v1/users/login

it failed

Letting you know that i have many container and all each has a vhost.

127.0.0.1       ucp.mydomain.localhost
127.0.0.1       checkout.mydomain.localhost
127.0.0.1       merchant.mydomain2.localhost
127.0.0.1       admin.mydomain3.localhost
127.0.0.1       core.mydomain3.localhost

Source