Docker how to specify an ip address with docker-compose

  docker, docker-compose

I use docker-compose to charge my container, I need to connect between container and host, so I need an ip that I always could access, I know docker’s default ip on linux is 172.17.0.x, but something strange is that every time I start up the container the ip will change, from 172.18.0.1 to 172.19.0.1 to 172.20.0.1 and etc …, step by step

Source: StackOverflow

LEAVE A COMMENT