How can the host computer obtain the ip address of the docker container container?

  docker, question

The docker host and container need to perform some file synchronization operations, and need to obtain the ip address of the container container. How should I obtain it?

docker inspect --format='{{.NetworkSettings.IPAddress}}' $CONTAINER_ID