So, I'm calling a web-site (e.g https://ipinfo.io/ip) from dockerfile. Also I want to pass this traffic from ssh local port-forward tunnel.
so what I did,
- create ssh tunnel
sudo ssh -N -L 0.0.0.0:443:ipinfo.io:443 my-username@xx.xx.xx.xx
- add
ipinfoin/etc/hosts
127.0.0.1 ipinfo.io
- create a Dockerfile like
FROM alpine
RUN apk add curl
RUN curl https://ipinfo.io/ip
so what happened ipinfo.io could resolve in loopback, but doesn't go through ssh tunnel.
How could I call ipinfo.io from docker, so that it goes through ssh tunnel?
P.S: I'm using macOS High Sierra