649 docker run --name consul1 -d -p 8500:8500 -p 8300:8300 -p 8301:8301 -p 8302:8302 -p 8600:8600 --restart=always consul agent -server -bootstrap-expect 2 -ui -bind=0.0.0.0 -client=0.0.0.0
650 docker inspect --format='{
{.NetworkSettings.IPAddress}}' consul1
651 docker run --name consul2 -d -p 8501:8500 --restart=always consul agent -server -ui -bind=0.0.0.0 -client=0.0.0.0 -join 172.17.0.2
652 docker run --name consul3 -d -p 8502:8500 --restart=always consul agent -server -ui -bind=0.0.0.0 -client=0.0.0.0 -join 172.17.0.2
This is because the value of 650 docker inspect --format='{ {.NetworkSettings.IPAddress}}' consul1 will change and the leader cannot be found