title: Docker with a new nameserver
body: <p>How I can add new nameserver in <code>/etc/resolv.conf</code> (dockerfile)?</p>
  
  <p>On my dockerfile I use:</p>
  
  <pre><code>FROM ubuntu:14.04
  
  RUN echo "nameserver 10.111.122.1" &gt;&gt; /etc/resolv.conf
  </code></pre>
  
  <p>On my test I use:</p>
  
  <pre><code>docker run --rm 746cb98d6c9b echo cat /etc/resolv.conf
  </code></pre>
  
  <p>I didn't get my change (the new nameserver)... So I try adding mannualy with </p>
  
  <pre><code>docker run --rm 746cb98d6c9b echo "nameserver 10.111.122.1" &gt;&gt; /etc/resolv.conf 
  </code></pre>
  
  <p>and I get </p>
  
  <pre><code>zsh: permission denied: /etc/resolv.conf
  </code></pre>
  
  <p>How I can change permission of this file OR use a root user OR use a chmod in docker files ? My real task is to add and dns server for my build of this dockerfile.</p>
  
  <p>I'm using a linux mint.</p>
  
  <p>I'm get a correct result with a ping test on docker run command (with <code>--dns</code>)</p>