How to access host port from docker container

前端 未结 14 1561
南旧
南旧 2020-11-22 03:41

I have a docker container running jenkins. As part of the build process, I need to access a web server that is run locally on the host machine. Is there a way the host web s

14条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 04:06

    Use --net="host" in your docker run command, then localhost in your docker container will point to your docker host.

提交回复
热议问题