title: Docker failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease
body: <p>I found some weird issue when trying to build my docker image in my house, although I am not sure if it's correlated to browser or just a network issue.</p>
  
  <p>So here's what I got. I tried to run this command in my Dockerfile.</p>
  
  <pre><code>RUN apt-get update -qq &amp;&amp; \
      apt-get install -y build-essential \
          libpq-dev \
          postgresql-client
  </code></pre>
  
  <p>After waiting for a moment, somewhat the process output something like this.</p>
  
  <pre><code>W: Failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease  
  
  W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease  
  
  W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease  
  
  W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg  Temporary failure resolving 'deb.debian.org'
  
  W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg  Temporary failure resolving 'security.debian.org'
  
  W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/Release.gpg  Temporary failure resolving 'deb.debian.org'
  
  W: Some index files failed to download. They have been ignored, or old ones used instead.
  </code></pre>
  
  <p>The weird thing is that, if I tried this in my office network, this does not happen. And then if I tried tethering to my cellphone data network, this also does not happen.</p>
  
  <p>I tried opening <code>http://deb.debian.org/debian/dists/jessie/InRelease</code> in browser, it shows 404. I tried using Tor browser via several networks, it also shows 404.</p>
  
  <p>The docker image is based on <code>ruby:2.3.1</code>.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I tried to use the DNS provided by my house provider <code>203.142.82.222</code>.</p>
  
  <pre><code>sudo docker run --dns 203.142.82.222 busybox nslookup google.com
  </code></pre>
  
  <p>This resolves</p>
  
  <pre><code>Server:    203.142.82.222
  Address 1: 203.142.82.222 dns-cache1.biz.net.id
  
  Name:      google.com
  Address 1: 2404:6800:4003:808::200e sin10s07-in-x0e.1e100.net
  Address 2: 117.102.117.245
  Address 3: 117.102.117.251
  Address 4: 117.102.117.212
  </code></pre>
  
  <p>But then I changed to <code>/etc/default/docker</code> file and added this.</p>
  
  <pre><code>DOCKER_OPTS="--dns 203.142.82.222 --dns 203.142.84.222"
  </code></pre>
  
  <p>After I restarted the docker <code>sudo service docker restart</code>, I tried again but it's still not working.</p>
  
  <pre><code>sudo service docker restart
  sudo docker run busybox nslookup google.com
  Server:    8.8.8.8
  Address 1: 8.8.8.8
  
  nslookup: can't resolve 'google.com'
  </code></pre>