Skip to content

Commit adc7929

Browse files
committed
fix(build): exclude files from build context if not used in dockerfiles
1 parent 5c2ee31 commit adc7929

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

.dockerignore

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
**/node_modules/
2-
*/build/
3-
*/*/build/
2+
43
**/venv/
54
**/.tox/
65
**/.mypy_cache/
@@ -9,19 +8,32 @@
98
**/__pycache__/
109
out
1110
**/*.class
12-
# Have to copy gradle/wrapper/gradle-wrapper.jar, can't exclude ALL jars
13-
**/build/**/*.jar
14-
# Jars/Wars that are final outputs of java projects.
11+
12+
# Exclude source code (not needed in Docker images, only build artifacts)
13+
**/*.java
14+
15+
# Exclude unnecessary build subdirectories but keep libs/
16+
**/build/classes/
17+
**/build/generated/
18+
**/build/reports/
19+
**/build/test-results/
20+
**/build/tmp/
21+
# Jars/Wars that are final outputs of java projects - keep these!
1522
!**/build/libs/*.war
1623
!**/build/libs/*.jar
1724
!datahub-frontend/build/stage/main/**
1825

19-
# Content in .git is used to get the git version
20-
# Just ignore the heavy parts that are not used
21-
.git/logs
22-
.git/COMMIT_*
23-
.git/index
26+
# Content in .git is used to get the git version during gradle stage, not in docker builds.
27+
.git
2428
.gradle
29+
**/.gradle/
2530

2631
/metadata-ingestion/tests
2732
/metadata-ingestion/examples
33+
34+
# Exclude - included via datahub-frontend
35+
datahub-web-react/
36+
37+
# Exclude docs build artifacts
38+
docs-website/build/
39+
docs-website/.docusaurus/

docker/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ quickstart_configs.each { taskName, config ->
451451
} else {
452452
buildCmd += ["docker", "buildx" ]
453453
buildCmd +=bakeCmdArgs
454+
buildCmd += ["--provenance=false"]
454455
}
455456
commandLine buildCmd
456457
workingDir rootProject.projectDir

0 commit comments

Comments
 (0)