I have a CentOS 7.0 host machine, with Docker version 19.03.4, build 9013bf583a installed. I am trying to create a simple docker image
I have a the following Docker file (dockerfile.txt).
RUN ping 188.8.131.52
I then execute the following command
sudo docker build --network=host --file=dockerfile.txt --tag=myrep/image1 --rm=true .
I see the following output
Step 1/3 : FROM alpine:edge
Step 2/3 : MAINTAINER javaonfly
—> Using cache
Step 3/3 : RUN ping 184.108.40.206
—> Running in 678b317bbc2c
PING 220.127.116.11 (18.104.22.168): 56 data bytes
I observe that the PING is stuck for very long. If I execute the same docker file on AWS EC2 linux machine I see the response to the ping.
On the host machine, I can successfully run the command docker run hello-world. I can also ping to www.google.com from host machine. But, it seems the alpine:edge container is not able to connect to internet.
I am completely stuck as I do not understand what settings should I check. Thanks.