title: Docker, Why Sudo Doesn't Work as Expected?
body: <p><strong>Note: Everyone is pointing to other problems and yet ignoring my main problem...</strong></p>
  <p>My docker file looks like this:</p>
  <pre><code># BUILD: docker build -t default_credentials ./
  # RUN: docker run -u root -t -i default_credentials
  
  FROM ubuntu:latest
  FROM python:latest
  
  RUN apt-get update -y &amp;&amp; apt-get upgrade -y
  
  ADD default_credentials ./default_credentials
  
  RUN pip3 install -r ./default_credentials/requirements.txt
  
  RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ 
      &amp;&amp; echo &quot;deb http://dl.google.com/linux/chrome/deb/ stable main&quot; &gt;&gt; /etc/apt/sources.list.d/google.list
  
  RUN apt-get update &amp;&amp; apt-get -y install google-chrome-stable
  
  RUN apt-get update &amp;&amp; apt-get -y install nmap
  
  RUN apt-get -y install sudo
  
  CMD /bin/bash
  </code></pre>
  <p>When it starts running I type:</p>
  <pre><code> sudo nmap -PE -sn 10.0.0.2
  </code></pre>
  <p>But the output doesn't contain the device mac address which means nmap didn't run with high privileges, how can I fix this?</p>
  <p>Please Note: Only if I run nmap on my PC as sudo it shows the mac address, else it won't report the mac address.</p>