docs icon indicating copy to clipboard operation
docs copied to clipboard

WORKDIR behavior description contradicts COPY --from description

Open jedahan opened this issue 8 months ago • 0 comments

Is this a docs issue?

  • [X] My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

These two excerpts from the documentation contradict each other. Which one is true?

From https://docs.docker.com/reference/dockerfile/#workdir

The WORKDIR instruction sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile.

From https://docs.docker.com/reference/dockerfile/#copy---from

The source path of COPY --from is always resolved from filesystem root of the image or stage that you specify.

Location

https://docs.docker.com/reference/dockerfile/

Suggestion

Assuming that COPY --from ignores the WORKDIR definition, I'd propose the following two items:

Add a note with all the exceptions to WORKDIR in the WORKDIR section.

Add a note that COPY --from will ignore WORKDIR in the COPY --from section.

jedahan avatar Jun 05 '24 15:06 jedahan