Docker Build Cannot Connect to Internet

Example scenario:

 1[root@selenium php-5.1.2]# docker build -t php5_1_2 .
 2Sending build context to Docker daemon  8.071MB
 3Step 1/9 : FROM nubs/arch-build
 4 ---> a68cd3855bfe
 5Step 2/9 : MAINTAINER Spencer Rinehart <anubis@overthemonkey.com>
 6 ---> Using cache
 7 ---> 0d099a2cd179
 8Step 3/9 : COPY php/PKGBUILD php/*.patch /package/
 9 ---> Using cache
10 ---> e9a68b923b81
11Step 4/9 : RUN makepkg --force
12 ---> Running in 22c4f167216a
13==> Making package: php 5.1.2-1 (Wed May  9 21:15:05 UTC 2018)
14==> Checking runtime dependencies...
15==> Checking buildtime dependencies...
16==> Retrieving sources...
17  -> Downloading php-5.1.2.tar.gz...
18  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
19                                 Dload  Upload   Total   Spent    Left  Speed
20  0     0    0     0    0     0      0      0 --:--:--  0:00:06 --:--:--     0

In docker CE, added the value of host's /etc/resolv.conf to /var/lib/docker/network/files/resolv.conf

Then, restart docker

Some details and other use cases in https://stackoverflow.com/questions/25130536/dockerfile-docker-build-cant-download-packages-centos-yum-debian-ubuntu-ap