I have a server running on localhost:3440 on the host machine. In a Dockerfile I have:
RUN apt-get install -y netcat
RUN nc localhost 3440 | tar -x -O > ores-$(date +%s.%N).tgz
I've read that using --net="host"
with docker run
will allow a running container to connect to a server running on the host. But my question is - when building an image, how can I connect to a server on localhost?
The error I get is simply:
localhost [127.0.0.1] 3440 (?) : Connection refused
anyone know what I might be doing wrong?