View method: 1. Use the "docker inspect --format='{{.NetworkSettings.IPAddress}}'" command; 2. Use the "docker exec -it ID/NAMES ip addr" command.
[Related recommendations:Docker video tutorial]
View the underlying information of Docker.
docker inspect will return a JSON file recording the configuration and status information of the Docker container
docker inspect NAMES # 查看容器所有状态信息; docker inspect --format='{{.NetworkSettings.IPAddress}}' # 查看 容器ip 地址 docker inspect --format '{{.Name}} {{.State.Running}}' # 容器运行状态
View process information
docker top NAMES
View port; (use container ID or container name)
docker port ID/NAMES
You can also check the IP address directly by using remote execution command(Centos7);
docker exec -it ID/NAMES ip addr
For more programming-related knowledge, please visit:Introduction to Programming! !
The above is the detailed content of How to check the container IP address in Docker?. For more information, please follow other related articles on the PHP Chinese website!