docs icon indicating copy to clipboard operation
docs copied to clipboard

WORKDIR behavior description contradicts COPY --from description

Open jedahan opened this issue 1 year ago • 8 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

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

docker-robot[bot] avatar Sep 03 '24 01:09 docker-robot[bot]

/remove-lifecycle stale

jedahan avatar Sep 03 '24 14:09 jedahan

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

docker-robot[bot] avatar Dec 02 '24 01:12 docker-robot[bot]

/remove-lifecycle stale

jedahan avatar Dec 02 '24 03:12 jedahan

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

docker-robot[bot] avatar Mar 02 '25 01:03 docker-robot[bot]

/remove-lifecycle stale

jedahan avatar Mar 02 '25 13:03 jedahan

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

docker-robot[bot] avatar May 31 '25 01:05 docker-robot[bot]

/remove-lifecycle stale

jedahan avatar May 31 '25 01:05 jedahan