Search code examples
dockerdockerfiledocker-imagedocker-build

Is `.` destination for the ADD/COPY dockerfile commands resolved with respect to WORKDIR?


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)?


Solution

  • 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 .