Skip to content

Instantly share code, notes, and snippets.

@nordineb
Created March 2, 2022 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nordineb/a1176f7c22db918a5620965e450a8c5d to your computer and use it in GitHub Desktop.
Save nordineb/a1176f7c22db918a5620965e450a8c5d to your computer and use it in GitHub Desktop.
Access host from docker

Desc

docker.for.mac.host.internal, docker.for.mac.localhost, docker.for.mac.gateway.internal are deprecated, you must now use host.docker.internal, vm.docker.internal, and gateway.docker.internal

Testing

on the host:

nc -l 0.0.0.0 8899
$ docker run -it --rm  alpine

# apk --no-cache add curl 
# curl -X GET host.docker.internal:8899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment