The WORKDIR
instruction defines the working directory for any RUN
, CMD
, ENTRYPOINT
,
COPY
, and ADD
instructions that follow in the Dockerfile.
Using absolute paths helps to avoid any confusion or
unexpected behavior that could arise, for example after changing the current directory in one of the previous instructions.