Docker link does not seem to have any problem in the future, but there is still a problem in practice. How to solve it?

  docker, question

First of all, I have two containers on docker, one is springboot jar, the other is redis, ip and port are 172.17.0.2 6379. The following is my redis configuration for application.yml
clipboard.png
Execute this order
After $ dockerrun-p8080: 8080-namexa-01-linkredis-6379: xa-02xa01, etc/hosts in jar containers look like this.
clipboard.png
Why is my springboot project still not linked to the redis database?

Well, I did it again because there is cache in some places, so this can still be ping