How to change the Docker-compose default IP address?

If the Docker-compose default IP subnet is conflicting with your internal network hosts access, you can change the default Docker subnet by following these steps:

  1. First, you need to enter the correct folder where Docker-compose is stored. Use the following two commands:
    cd /opt/visionect 
    sudo vim docker-compose.yml
  2. Next, change the subnet IP inside the docker-compose file by copying this code on the end of the docker-compose file: 
    driver: default
    - subnet: (enter the desired subnet)
  3. Remove the current container and build up the new container by using this command:
    sudo docker-compose down && sudo docker-compose up -d


And that’s it!

If you wish you learn more about changing the Docker default subnet IP address, click here.