Docker failing to add remote file with 'too many redirects'

1.7k Views Asked by At

I'm trying to build the following Dockerfile:

FROM ubuntu-debootstrap:trusty
ENV CONFD_VERSION 0.6.3
ENV CONFD_INTERVAL 30
ENV CONFD_NODE 172.17.42.1:4001
ENV CONFD_BACKEND etcd
RUN apt-get update -q \
  && DEBIAN_FRONTEND=noninteractive apt-get install -y -q nginx \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists
ADD https://github.com/kelseyhightower/confd/releases/download/v0.6.3/confd-0.6.3-linux-amd64 /usr/local/bin/confd
RUN chmod +x /usr/local/bin/confd /usr/local/bin/confd
EXPOSE 80
CMD confd -verbose -interval $CONFD_INTERVAL -backend $CONFD_BACKEND -node $CONFD_NODE

But it fails trying to fetch the remote file with a 'too many redirects' error:

$ docker build -t confdrouter .
Sending build context to Docker daemon  16.9 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu-debootstrap:trusty
 ---> 21530629f1e1
Step 1 : ENV CONFD_VERSION 0.6.3
 ---> Using cache
 ---> 070ff91dc728
Step 2 : ENV CONFD_INTERVAL 30
 ---> Using cache
 ---> 2d30a2f30f85
Step 3 : ENV CONFD_NODE 172.17.42.1:4001
 ---> Using cache
 ---> 96915c53a9aa
Step 4 : ENV CONFD_BACKEND etcd
 ---> Using cache
 ---> 5d770c929056
Step 5 : RUN apt-get update -q   && DEBIAN_FRONTEND=noninteractive apt-get install -y -q nginx   && apt-get clean   && rm -rf /var/lib/apt/lists
 ---> Using cache
 ---> 5c2465522a1c
Step 6 : ADD https://github.com/kelseyhightower/confd/releases/download/v0.6.3/confd-0.6.3-linux-amd64 /usr/local/bin/confd
2014/11/07 11:31:57 Get https://s3.amazonaws.com/github-cloud/releases/13234395/5e2257d4-4f46-11e4-92c7-d029c6449976.3-linux-amd64?response-content-disposition=attachment%3B%20filename%3Dconfd-0.6.3-linux-amd64&response-content-type=application/octet-stream&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1415381577&Signature=WWdGHk8K3%2BIQyl7Cl4UcBN8aDQM%3D: dial tcp: lookup s3.amazonaws.com on [10.0.2.3]:53: too many redirects

Running boot2docker 1.3.1 on Mac OS X 10.10. Any idea what is going on here?

1

There are 1 best solutions below

0
On BEST ANSWER

Looks like the error is coming from DNS, and the DNS server is at 10.0.2.3. This is the address that VirtualBox maps for DNS.

Very similar question at How to fix Docker's "Error pulling image...too many redirects" failures while pulling images from registry?, with advice to use Google's DNS at 8.8.8.8, which is generally excellent.