I'm having trouble trying to add a default host to a docker image. I have my simple file Dockerfile
with this:
FROM alpine
RUN echo "172.17.0.1 test.docker" >> /etc/hosts
I build the image by running
docker build -t example -f Dockerfile .
Running the container and checking the /etc/hosts file never finds the host that I added when I built the image. I tried using another OS other than Alpine and still get the same thing. Why is this happening and how can I achieve it?