3

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.

orberkov
  • 195
  • 7

1 Answers1

2

As per this docker documentation 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.

storm
  • 1,759
  • 3
  • 15
  • 34