0

I'm running applications using docker containers. I run it with docker-compose. For example there is arangodb dependency:

  arangodb:
image: localartifactiory/arangodb:3.2.5
volumes_from:
  - arangodb_data
ports:
  - 8530:8529
environment:
  - ARANGO_ROOT_PASSWORD=admin

I can reach the service with http://localhost:8530, but I can't reach it using service name http://arangodb:8530 or http://arangodb:8529 in browser, still it looks like my application connects to this db by http://arangodb:8529 address.

Can you please tell me if it is possible to reach my service using service-based-url from browser or is it internal docker address that can be reached only inside containers?

Claudio
  • 10,614
  • 4
  • 31
  • 71
Sergei Podlipaev
  • 1,331
  • 1
  • 14
  • 34

2 Answers2

2

The service name url is available due to the embedded DNS server in user-defined networks. This DNS server is only used to resolve DNS requests for containers that are part of the network.

Check Query docker embedded dns from host to see how to resolve DNS names using the embedded DNS server

yamenk
  • 46,736
  • 10
  • 93
  • 87
0
  • To access service externally (from the browser) you need to use IP_ADDRESS of the host machine. Host machine means Windows/Ubuntu/ Mac, actual machine address.

  • To access service internally from one container to another then you can use container name (e.g. http://arangodb:8529).

let me know if you need any further details.

Rohan J Mohite
  • 2,283
  • 10
  • 19