aws-samples / amazon-sagemaker-local-mode

Amazon SageMaker Local Mode Examples
MIT No Attribution
242 stars 59 forks source link

host.docker.internal is not working #23

Closed longbowzhang closed 1 year ago

longbowzhang commented 1 year ago

Hi,

I am following the example of debugging with pycharm in sagemaker local mode, but unfortunately failed. The error is "(socket.gaierror: [Errno -2] Name or service not known)". Docker version is 20.10.17 and OS is ubuntu 18.04.

Some addition information: For Mac, I have to change "host.docker.internal" to "docker.for.mac.host.internal" to make is work.

Any idea how to make it work on Linux?

Thanks in advance.

longbowzhang commented 1 year ago

For those who are interested, I simply replace host.docker.internal by the Gateway address of the sagemaker-local network (via docker network inspect ${sagemaker-local} --format='{{( index .IPAM.Config 0).Gateway}}), and now it works as expected.