I am trying to build and run a docker container of one of my services from the Dockerfile. I need to add some extra host to the container. I know that in the docker compose file you can add:
extra_hosts:
- "DEV01:172.16.0.10"
- "DEV02:172.16.0.11"
- "DEV03:172.16.0.12"
However I need to build the image directly from the docker file. How do I add these extra hosts?
I have tried add --add-host=[] to the docker run which some people have suggested but that doesn't seem to work.