In my docker file while building i want to access files on my host machine from localhost server rather than copying them to the docker context folder (i.e the place where Dockerfile is located)
FROM busybox
RUN curl -L http://localhost/latest/myfile -o /root/myfile
I get errror:
$ docker build -t archlinux/test .
... from localhost : Failed to connect to localhost port 80: Connection refused
So how to do it.
Solution: to use localhost/file
Use IP of the localhost for that change the
Listen 127.0.0.1:80 to Listen 80
Or
Best solution is use --network=host
docker build --network=host -t test .