feat: respect dockerignore on initial source load#373
Open
iloveitaly wants to merge 12 commits intomainfrom
Open
feat: respect dockerignore on initial source load#373iloveitaly wants to merge 12 commits intomainfrom
iloveitaly wants to merge 12 commits intomainfrom
Conversation
d013600 to
34799db
Compare
I'm not sure how it got into this state :/
…er in the build process
ea542ce to
c8951f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
I noticed that when building locally dockerignore was not respected. The build process would load everything into buildkit and then later on it was filtered. This caused local
railpack buildcalls to be very slow (loading 1gb of node_modues or .venv)This occurs because we apply the exclude/include filters after the local build context is established via the buildkit llb.
Separately, I'd like to establish a 'default'
.dockerignorefor different providers (or maybe just one globally? Unsure.). We sort of do this right now withnode_modulesand I had an LLM take a stab at it with #363. However, it would make a lot more sense to eliminate the miscnode_modulesexcludes scattered across the build process and just apply when pulling the app local context via a default dockerignore rule set that can also be explicitly documented in a single location in docs and in-code. This isn't fixed in this PR, but this change lays the groundwork for that change so it'll be relatively easy to do.Another issue I discovered is a user must use a
.dockerignoreto exclude/include files. We sort of supported include/exclude at the step-level but did not support it at the top-level of therailpack.json. This was confusing to me, and I imagine to users.Change
railpack.json