Skip to content

Commit 2a0d760

Browse files
authored
Exclude unnecessary files from local Pack CLI builds (#258)
Exclude unnecessary files from images when building locally with `pack build`, where `.gitignore` doesn't apply. See: - https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/use-project-toml/ - https://buildpacks.io/docs/reference/config/project-descriptor/#iobuildpacks-table-optional - https://github.com/buildpacks/spec/blob/main/extensions/project-descriptor.md#iobuildpacksinclude-optional-and-iobuildpacksexclude-optional Note: We have to omit trailing slashes from entries that are directories due to this upstream bug: buildpacks/pack#2402 GUS-W-18705417.
1 parent 461f1ac commit 2a0d760

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

project.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[_]
2+
schema-version = "0.2"
3+
4+
[io.buildpacks]
5+
# Exclude files from local Pack CLI builds, where .gitignore doesn't apply.
6+
# TODO: Add trailing slash to entries that are directories, once this issue is fixed:
7+
# https://github.com/buildpacks/pack/issues/2402
8+
exclude = [
9+
"__pycache__",
10+
".git",
11+
".gitignore",
12+
".github",
13+
".venv",
14+
".DS_Store",
15+
".env",
16+
"staticfiles",
17+
"db.sqlite3",
18+
"venv",
19+
]

0 commit comments

Comments
 (0)