0

I have 2 hosts with Docker: Ubuntu and Windows(docker-desktop). I want to connect a container with Adminer(Windows) to a container with MariaDB(Ubuntu). Is it possible?
My hosts locate in the same local network, and containers are isolated from each other(of course). I was trying to create overlay network and to bind between each other, but worker's message has been: "docker: Error response from daemon: attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded."
My goal is to make communication between different host containers. Please, can you help me with my problem :)

aicatsana
  • 11
  • 1
  • 1
    Have you tried to just expose the port and use : to connect from one to another? – jabbson Dec 02 '21 at 15:31
  • Any TCP port can be mapped to any host regardingless of the operating system. This is on what the internet is built on. – danlooo Dec 02 '21 at 15:33

1 Answers1

0
  • Important: Make sure your host machines can communicate with each other over the network, and there are no issues due to network firewalls, etc.
  • Looks like need to bind the port of your container to your host machine.
  • When you are running your Docker containers use the -p option. You can find a lot of examples at https://docs.docker.com/config/containers/container-networking/.
  • After you have exposed your containers port, you can access them using <host-machine-ip>:<host-machine-port-you-used-to-bind-container>