0

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
Dahab
  • 518
  • 1
  • 5
  • 23
  • Does this answer your question? [How to access Docker container from another machine on lan](https://stackoverflow.com/questions/39261743/how-to-access-docker-container-from-another-machine-on-lan) – Nico Haase Jan 21 '22 at 15:45
  • Or this? https://stackoverflow.com/questions/59742576/access-docker-container-from-local-area-network-devices – Nico Haase Jan 21 '22 at 15:45
  • If this works, then you can, for example, run `docker run -H tcp://192.168.0.63:2375 -v /:/host busybox vi /host/etc/shadow` to reset the host root user's password to an empty string. You really don't want to open up a remote root vulnerability like this. Close the Docker TCP socket access immediately. – David Maze Jan 21 '22 at 16:07

0 Answers0