Why docker build flag --add-host is not working on linux ubuntu ?

Viewed 2654

I am trying to run my docker development setup and I can't access host from

docker build --add-host mymachinelocalip:ss-local

in my production ubuntu envrionment, by caling in Dockerfile:

RUN curl -f http://ss-local:8181

my /etc/hosts :

::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.1  ss-local
172.17.0.5  e1ede117fb1e

On my local computer (MacOSX El Capitan and Windows10) everything works perfect.. But on digitalocean droplet with Ubuntu curl command fail.

I am beginer with docker.. and I am wondering maybe there is some kind of firewall on linux that prevent connections to host...

Ubuntu 16.04.2 LTS with Docker version 17.06.0-ce, build 02c1d87.

1 Answers
Related