Answers: <p>As per this <a href="https://docs.docker.com/engine/reference/builder/#copy" rel="nofollow noreferrer">docker documentation</a> the copy instruction may have multiple sources but only one destination.<br>
  Your first copy is coping two file <code>/etc/passwd</code> and <code>/etc/group</code> to <code>/etc</code>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-11-14T02:32:48.320Z
Answers: does installing `docker` from `snap` cause path problems with the `COPY` command?
Answers: Nicholas Saunders
Answers: CC BY-SA 4.0
Answers: 2018-09-02T21:32:33.247Z
Answers: 2018-09-02T21:32:33.247Z
Answers: storm
Body: <p>I've encountered a Multi-stage Build example, where the first stage builds a ngnix server, and the second stage creates a ngnix service from that image.  </p>
  
  <p>The second stage looks like this:</p>
  
  <pre><code>...
  # second stage
  FROM scratch
  COPY --from=build /etc/passwd /etc/group /etc/
  COPY --from=build /usr/local/nginx /usr/local/nginx
  COPY index.html /usr/local/nginx/html
  ...
  </code></pre>
  
  <p>This is a working example.</p>
  
  <p>Now, notice the first COPY command. It received three parameters(!)</p>
  
  <p>What is the meaning of 3 parameters in the COPY command? do you have a reference to documentation regarding this input?</p>
  
  <p>Notice that the second COPY command uses 2 parameters, which I assumed are src and dest folders.</p>
  
Tags: <docker><dockerfile><builds><nginx>
Title: Dockerfile COPY command with three input parameters
UserDisplayName: orberkov
ThreadText: # Dockerfile COPY command with three input parameters
  
  (Asked by: username_0 on 2018-09-02)
  
  I've encountered a Multi-stage Build example, where the first stage builds a ngnix server, and the second stage creates a ngnix service from that image.
  
  The second stage looks like this:
  
  ```
  ...
  # second stage
  FROM scratch
  COPY --from=build /etc/passwd /etc/group /etc/
  COPY --from=build /usr/local/nginx /usr/local/nginx
  COPY index.html /usr/local/nginx/html
  ...
  
  ```
  
  This is a working example.
  
  Now, notice the first COPY command. It received three parameters(!)
  
  What is the meaning of 3 parameters in the COPY command? do you have a reference to documentation regarding this input?
  
  Notice that the second COPY command uses 2 parameters, which I assumed are src and dest folders.
  
  **Tags:** docker, dockerfile, builds, nginx
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-09-02. Score: 2 | Accepted answer
  
  As per this [docker documentation](https://docs.docker.com/engine/reference/builder/#copy) the copy instruction may have multiple sources but only one destination.  
  Your first copy is coping two file `/etc/passwd` and `/etc/group` to `/etc`.
  
  > **Comments:**
  > **username_2**: does installing `docker` from `snap` cause path problems with the `COPY` command?  
  
  ---
  
  