When you're using the Gradle Docker image and buil...
# community-support
m
When you're using the Gradle Docker image and building with
gradle
(not
./gradlew
), is it fairly standard to add this to
.dockerignore
?
Copy code
gradle*
!gradle/libs.versions.toml
Or could be there be complications here?
v
Well, depends on your project. You could have your convention plugins in there too, or dependency lock and verification state and so on. I'm not sure it brings really much benefit, but if you really think so, you might consider just excluding
gradle/wrapper/
instead.
m
So this would be better, right?
Copy code
gradle/wrapper
gradlew*
v
Probably, but still I'm not sure whether that really gives any advantage at all
t
you would safe minimal image space (43kb) by omitting the gradle-wrapper.jar. But it can have some sideffects because you are also omitting the gradle-daemon.jvm.properties for example, it may cause some confusion that this file would exist on the host but not in the container. You could argue that that the daemon-jvm.properties shouldn't matter because in the container the jvm should be clearly defined anyways, but thats not necessary true or the intended workflow.. So I would not bother about the
gradle
dir I think its probably more relevant to add
.gradle
(leading dot) to dockerignore, these are some caches created on the host and are probably not useful inside the container
👆 1