title: `--chown` option of COPY and ADD doesn't allow variables. There exists a workaround?
body: <p>In a Dockerfile, the common way to copy a directory as a non-root user (e.g $UID 1000) is the following:</p>
  
  <pre><code>COPY --chown=1000:1000 /path/to/host/dir/ /path/to/container/dir
  </code></pre>
  
  <p>However, I want to use variables instead. For example</p>
  
  <pre><code>ARG USER_ID=1000
  ARG GROUP_ID=1000
  COPY --chown=${USER_ID}:${GROUP_ID} /path/to/host/dir/ /path/to/container/dir
  </code></pre>
  
  <p>But this is not possible. There exist a workaround?</p>
  
  <p><strong>Note</strong> I know that a possible workaround could be to copy the directory as root and then run chown on the directory (variables works fine with <code>RUN</code>). However, the size of the image will grow just for the use of chown in a separate command.</p>