Category: Docker

You may have been tempted to have the following line in the Dockerfile but it won't work because Docker Daemon manages container's /etc/hosts file.

RUN ....
echo " host.docker.internal" >> /etc/hosts

The solution is to use extra hosts parameter to the docker-compose.yml file.

  - "some-host:"

Usually the extra hosts section is used to pass host-gateway's IP which is host's ip the container so the container can connect to the host.

  - "host.docker.internal:host-gateway"

Join our mailing list

Get important news about cool products we release and invitations to beta test new products

Find out the Social networks we're on