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

dockerfile2llb: filter unused paths for named contexts #4161

Merged
merged 1 commit into from
Dec 11, 2023

Commits on Nov 15, 2023

  1. dockerfile2llb: filter unused paths for named contexts

    This changes the llb generation in `dockerfile2llb` to add the
    `llb.FollowPaths` option when named contexts are used in the same way
    that happens with the default context.
    
    This means that dockerfiles that look like this:
    
    ```
    FROM scratch
    COPY --from=mynamedctx ./a.txt /a.txt
    ```
    
    Will only load the file `a.txt`. This behavior is consistent with the
    default context.
    
    This also removes the unused []llb.LocalOption from ContextOpt and
    replaces it with an async counterpart. This is needed because we
    initialize the named context before we know which paths are needed for
    the filter.
    
    Signed-off-by: Jonathan A. Sternberg <[email protected]>
    jsternberg committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    bee54f0 View commit details
    Browse the repository at this point in the history