title: Dockerfile - How to copy files from a local folder?
body: <p>Below is the <code>Dockerfile</code>:</p>
  <pre><code>FROM golang:1.14.10
  MAINTAINER xyz
  
  COPY ~/go/bin/product-api /go/bin/product-api
  
  COPY ~/go/bin/swagger /go/bin/swagger
  
  ENTRYPOINT [&quot;/go/bin/product-api&quot;]
  </code></pre>
  <hr />
  <p>on <code>docker build -t cloud-native-product-api:1.0.0 .</code>, gives error:</p>
  <pre><code>Step 3/5 : COPY ~/go/bin/product-api /go/bin/product-api
  COPY failed: stat /var/lib/docker/tmp/docker-builder398080099/~/go/bin/product-api: no such file or directory
  </code></pre>
  <hr />
  <p>I think the image build process takes <code>/var/lib/docker/tmp/docker-builder398080099</code> as workspace and refer from that path.</p>
  <p>How to copy files from specific folder of local machine into Docker image?</p>