I'm building my Docker image using Spring Boot's built in Gradle :bootBuildImage
task, which is quite convenient, because I don't have to maintain my own Dockerfile
.
The Gradle task uses the Paketo Bionic Base Stack under the hood and will build a layered Docker image just fine.
Now, some orchestration engines like Docker Swarm (or simply Docker Compose for dev purposes) execute health checks within the container. Unfortunately, however, the resulting Spring Boot Docker image doesn't have any health checker tools like curl
or wget
installed, so something like
version: '3.7'
services:
springBootApp:
image: my/springboot/docker-image
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:8080/actuator/health"]
in docker-compose.yml
will fail. (I checked that actuators themselves are working fine)
I know that curl
or wget
aren't ideal. I was actually hoping that the Paketo Builder would pick up something like this Health Checker BuildPack.
Is there a way to configure my bootBuildImage
Gradle task to include that (or a similar) additional BuildPack?
As mentioned above, I'm looking for an easy to maintain solution and don't want to write my own Dockerfile
to be able to profit from all the baked in best practices Paketo offers.