title: Why Docker Build Fails in Docker in Docker Jenkins Build: ‘/proc/1/map_files’: Operation not permitted
body: <p>The instruction below is correctly built in MacOS Docker Engine 18.04 while the same instruction fails when built in by a Jenkins Container running Docker (Docker-in-Docker, dind, Inception)... Why is the reason for the error and what's the workaround?</p>
  
  <h1>local docker build on MacOS</h1>
  
  <pre><code>Step 12/16 : RUN find / -name "spring-cloud-config-server*.jar" 
                 ! -name "*sources*" -exec cp -t /tmp {} + &amp;&amp; 
                 mkdir /runtime &amp;&amp;
                 mv /tmp/spring-cloud-config*.jar /runtime/config-service.jar &amp;&amp;
                 rm -f /*.jar
   ---&gt; Using cache
  </code></pre>
  
  <h1>Docker-in-Docker Jenkins Build</h1>
  
  <pre><code>Step 12/16 : RUN find / -name "spring-cloud-config-server*.jar" 
                 ! -name "*sources*" -exec cp -t /tmp {} + &amp;&amp; 
                 mkdir /runtime &amp;&amp;
                 mv /tmp/spring-cloud-config*.jar /runtime/config-service.jar &amp;&amp;
                 rm -f /*.jar
  
   ---&gt; Running in f64908a07aa1
  find: ‘/proc/1/map_files’: Operation not permitted
  find: ‘/proc/7/map_files’: Operation not permitted
  
  The command '/bin/sh -c find / -name "spring-cloud-config-server*.jar" 
     ! -name "*sources*" -exec cp -t /tmp {} + &amp;&amp;   mkdir /runtime &amp;&amp;   
     mv /tmp/spring-cloud-config*.jar /runtime/config-service.jar &amp;&amp;   
     rm -f /*.jar' returned a non-zero code: 1
  
  script returned exit code 1
  </code></pre>