#docker (2022-05)

docker

All things docker

Archive: https://archive.sweetops.com/docker/

2022-05-27

sheldonh avatar
sheldonh

I have a hosts entry for my app such as:

127.0.0.1   dev.local.test

Now I can work on my app with local domain emulating this path like <http://dev.local.test/foo>.

My problem is figuring out how to keep this compatible with docker. Working on host is fine. However, if I use devcontainers or use a container in my dockerstack instead of live serving the app via ng serve… then these containers and services have no knowledge of the host alias I’ve set and won’t work.

I’m looking at extra_hosts and other options, but not seeing the exact solution yet.

Anyone know how to keep the host aliases functional with other docker containers so I can continue to use that alias both outside docker and with my docker compose stack (and eventually minikube/kind will need this too).

    keyboard_arrow_up