更新时间:2022-01-25 08:40:10
如果您正在使用Docker for Linux,则在运行时需要使用-network ="host"
作为参数 docker run
或 docker build
命令,则您的docker容器将可以访问主机的本地主机 127.0.0.1
.
If you are using Docker for Linux, You would need to use --network="host"
as argument when you are running docker run
or docker build
command, then your host machine's localhost 127.0.0.1
will be accessible to your docker container.