3

I'm using docker to make redmine running on server and I create another container with postgresql and link to one another.

I'm new using docker but I want my redmine container connect to my localhost postgresql instead linking to my another container.

How can I do that?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • If you use the Docker Engine on Linux, you could use the --net=host option, so your container is capable of interacting with the network stack of your host machine. See: https://docs.docker.com/v1.8/articles/networking/#how-docker-networks-a-container but since you tagged this with 'docker-machine' I assume you want to run this on Windows or OSX? – StateOfTheArt89 Jun 08 '16 at 07:32

1 Answers1

0

You could get the IP of the docker host from within your container, as explained in this answer (ip addr show eth0).

Or you can add localhost using the guest network interface (if you are using a VM)

--add-host="localhost:10.0.2.2"
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250