Docker in docker with Gradle. Used for CI.
-
Trivial: If you do not want/need to create your own special gradle-jdk combo, feel free to grab any of the images that we have created and pushed over the years here https://hub.docker.com/r/dtforce/dind-gradle/tags
-
Easy (still): If none of our combos suit your needs, find the base image with Gradle, OS and JDK combo you would like to use here https://hub.docker.com/_/gradle/ & see the
Howtosection bellow.
Example based on Gradle 8.14.4 with Alpine Linux and JDK 21
-
Touch the
Dockerfilein this repo accordingly (i.e. usegradle:8.14.4-jdk21-alpineinFROM) -
Build and push (change the
dtforcefor your own dockerhub organization)
docker build . -t dtforce/dind-gradle:v8.14.4-alpine-jdk21-py
docker push dtforce/dind-gradle:v8.14.4-alpine-jdk21-pyMac Silicon (Apple M-series) note: On ARM64 machines, docker build produces ARM64 images by default. CI environments typically require AMD64 images. Use buildx to target the correct platform:
docker buildx build --platform linux/amd64 . -t dtforce/dind-gradle:v8.14.4-alpine-jdk21-py --push- Use the built image in you CI/CD pipeline and enjoy