Skip to content

feat: respect dockerignore on initial source load#373

Open
iloveitaly wants to merge 12 commits intomainfrom
dockerignore-initial-load
Open

feat: respect dockerignore on initial source load#373
iloveitaly wants to merge 12 commits intomainfrom
dockerignore-initial-load

Conversation

@iloveitaly
Copy link
Collaborator

@iloveitaly iloveitaly commented Nov 20, 2025

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 build calls 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' .dockerignore for different providers (or maybe just one globally? Unsure.). We sort of do this right now with node_modules and I had an LLM take a stab at it with #363. However, it would make a lot more sense to eliminate the misc node_modules excludes 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 .dockerignore to exclude/include files. We sort of supported include/exclude at the step-level but did not support it at the top-level of the railpack.json. This was confusing to me, and I imagine to users.

Change

  • Apply exclude/includes at the buildkit level
  • Add exclude/include at the top-level of the railpack.json

@iloveitaly iloveitaly force-pushed the dockerignore-initial-load branch from d013600 to 34799db Compare January 19, 2026 19:27
@iloveitaly iloveitaly marked this pull request as ready for review January 19, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant