DEV Community

kohbis
kohbis

Posted on • Originally published at fushagoya.com

2 2

【Tips】Connect Host OS proccess by localhost from within Docker container

Tips for connecting Host OS process by localhost from within Docker container.

This is used when the container is running without using docker-compose for each process.

$ docker run -it --rm --add-host=localhost:$(ipconfig getifaddr en0) IMAGE
Enter fullscreen mode Exit fullscreen mode

Incidentally, if you don't use localhost and you are using Docker Desktop for Mac, you can connect using the DNS name host.docker.internal.

Top comments (0)

Jetbrains image

Is Your CI/CD Server a Prime Target for Attack?

57% of organizations have suffered from a security incident related to DevOps toolchain exposures. It makes sense—CI/CD servers have access to source code, a highly valuable asset. Is yours secure? Check out nine practical tips to protect your CI/CD.

Learn more