title: Docker: COPY failed: file not found in build context (Dockerfile)
body: <p>I'd like to instruct Docker to <code>COPY</code> my certificates from the local <code>/etc/</code> folder on my Ubuntu machine.</p>
  <p>I get the error:</p>
  <blockquote>
  <p>COPY failed: file not found in build context or excluded by
  .dockerignore: stat etc/.auth_keys/fullchain.pem: file does not exist</p>
  </blockquote>
  <p>I have not excluded in <code>.dockerignore</code></p>
  <p>How can I do it?</p>
  <p><strong>Dockerfile:</strong></p>
  <pre><code>FROM nginx:1.21.3-alpine
  
  RUN rm /etc/nginx/conf.d/default.conf
  RUN mkdir /etc/nginx/ssl
  COPY nginx.conf /etc/nginx/conf.d
  COPY ./etc/.auth_keys/fullchain.pem /etc/nginx/ssl/
  COPY ./etc/.auth_keys/privkey.pem /etc/nginx/ssl/
  
  WORKDIR /usr/src/app
  </code></pre>
  <p>I have also tried without the <code>dot</code> --&gt; same error</p>
  <pre><code>COPY /etc/.auth_keys/fullchain.pem /etc/nginx/ssl/
  COPY /etc/.auth_keys/privkey.pem /etc/nginx/ssl/
  </code></pre>
  <p>By placing the folder <code>.auth_keys</code> next to the Dockerfile --&gt; works, but not desireable</p>
  <pre><code>COPY /.auth_keys/fullchain.pem /etc/nginx/ssl/
  COPY /.auth_keys/privkey.pem /etc/nginx/ssl/
  </code></pre>