Reputation: 9724
Dockerfile ADD/COPY commands support the destination value to be a relative (to WORKDIR) path or an absolute path. Also, the source value is always the build context.
However, if the destination is specified as .
, then is it resolved with respect to the WORKDIR (and does it default to the root (C:) if WORKDIR is not specified)?
Upvotes: 1
Views: 771
Reputation: 880
WORKDIR app
this statement creates a folder named app and moves to that directory which is app
COPY <host> <container>
RUN cd
or WORKDIR
on dockerfile then the location would be relative to where you are presently in the container.Upvotes: 1
Reputation: 3480
Yes, your understanding is correct. .
will consider the current directory as WORKDIR(if it's specified) and if not, then by default it will consider to /
or root
directory as .
Upvotes: 2