Monday, February 18, 2019

Docker Network Related Issue When We Build Docker Images


  When I ran "docker build -t oracle/database:19c  .  "  , it always error out on yum repo issues as below [Errno 12] Timeout on (28, 'Resolving timed out after 30540 milliseconds')


I checked around proxy settings according to note. I didn't find any issues.
I added proxy settings into Dockerfile like below to inform yum to use proxy
RUN echo "proxy=http://<proxy server IP address>:80" >> /etc/yum.conf
"docker login" was working fine.
DNS entries in /etc/resolv.conf  of the container had correct settings
I  restarted docker daemon , didn't work

After checking around, I suspected it was related to docker network
We created a new bridge network in docker via "docker network create  henrynetwork"
In this way, we can force docker build to use new bridge network instead of default one
 "docker build --network=henrynetwork -t oracle/database:19c  .  "
It works.  So far I don't have any clue why default bridge network won't work.  But new bridge network will work around it. 

No comments: