Change default address used by Docker (172.17.0.1)

3

I would like to change (or remove) the address 172.17.0.1 used by docker networks, can you do that?

I use docker for php development and I have a remote repository (git) configured through a VPN using the IP range 172.17.X.X.

Whenever my containers are up, the docker network uses this IP range and I am unable to make any requests to the remote repository.

Thank you.

NOTE: I use a Linux environment (Mint 19)

I was able to solve my problem by defining a subnet in the network used by my containers in the docker-compose.yml file. This way:

networks:
  frontend:
    driver: bridge
    ipam:
      config:
        - subnet: 172.18.0.0/16
  backend:
    driver: bridge
    ipam:
      config:
        - subnet: 172.19.0.0/16
    
asked by anonymous 14.09.2018 / 14:00

1 answer

0

The default network settings ( bridge ) of Docker can be changed by editing the file daemon.json , in the /etc/docker/ directory. Here is an example of the file daemon.json :

 {
  "bip": "192.168.1.5/24",
  "fixed-cidr": "192.168.1.5/25",
  "fixed-cidr-v6": "2001:db8::/64",
  "mtu": 1500,
  "default-gateway": "10.20.1.1",
  "default-gateway-v6": "2001:db8:abcd::89",
  "dns": ["10.20.1.2","10.20.1.3"]
}

One option would be to configure a new network, using docker network create ...

In the documentation you can see more information about the available network drivers , how to set up a new network and how change the default settings%.

    
14.09.2018 / 14:15