docs icon indicating copy to clipboard operation
docs copied to clipboard

The documentation for the mount options under RUN instruction in the Dockerfile reference is inconsistent with actual implementation.

Open TyIsI opened this issue 1 year 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

The documentation for the RUN instruction in the Dockerfile reference is inconsistent with actual implementation. Or probably the other way around.

Options not specified in the documentation are unexpectedly supported and the source code for commands_runmount.go shows that restrictions listed in the documentation are not applied as such.

Examples:

## Works with all options
RUN --mount=type=tmpfs,target=/cache,size=1024,ro,readonly,rw,readwrite /bin/ls -asl /cache
## ERROR [internal] load metadata for docker.io/library/nonexistent:latest, but should not work
RUN --mount=type=tmpfs,target=/cache,size=1024,from=nonexistent /bin/ls -asl /cache
## Shows directories in root, documentation says from=<stage>, but happily loads image
RUN --mount=type=cache,target=/cache,from=alpine:3,source=/ /bin/ls -asl /cache

Location

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

Suggestion

I didn't test more extensively and I have no idea what's intentional, but I'll go open a ticket in the buildkit repo for this.

Happy weekend!

TyIsI avatar May 10 '24 19:05 TyIsI