A
A
Andrey2019-08-16 16:36:57
Docker
Andrey, 2019-08-16 16:36:57

How to setup network in docker?

Good day!
There is a physical server, a virtual machine is spinning in it, in which some API is running.
The API has a data.example.ru domain, it is assigned ip 10.2.0.1, which distributes the public DNS of the example.ru domain.
Now some daemons that work with this API are deployed on the physical server in the docker.
Deployed via docker-compose, something like this configuration:

Configuration

version: '3.7'
services:
  data-whatever:
    command: ["traceroute", "data.example.ru"]
    networks:
      - default
    volumes:
      - /srv/dev:/service
    build:
      context: .
      dockerfile: /srv/Dockerfile
networks:
  default:
    driver: bridge
    ipam:
      config:
        - subnet: 10.10.0.0/20

Actually, the question is, why can't I connect to the API from the container?
data-whatever_1  | traceroute to data.example.ru (10.2.0.1), 30 hops max, 60 byte packets
data-whatever_1  |  1  10.10.0.1 (10.10.0.1)  0.076 ms  0.033 ms  0.027 ms

and further * * * another 29 steps.
If you replace the address with ya.ru, it easily reaches Yandex.
ps extra_hosts didn't help either. it tries to apply the address as if it was returned by DNS, but shuts up in the same place...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question