컨테이너 내부에서 "host.docker.internal" 이라는 hostname 을 사용하면
host (즉, 컨테이너를 실행한 host OS) 와 연결됨

 


host ip 자체를 찾는 방법 : host server(host os) 에서 
sudo ip addr show docker0 실행

해당 ip 를 container 내에서 사용하면, host 로 연결됨.


참고 : https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach

 

 

 

 

 

+ Recent posts