Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
TyIsI opened this issue May 10, 2024 · 0 comments
Labels
status/triage Needs triage

Comments

@TyIsI
Copy link

TyIsI commented May 10, 2024

Is this a docs issue?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/triage Needs triage
Projects
None yet
Development

No branches or pull requests

1 participant