I have a docker image with a specific version in my tests (Java/Kotlin).
I want to make it updatable by Dependabot.
I've seen https://github.com/dependabot/dependabot-core/issues/6893
But I wonder if there is any way to make docker image versions visible for Dependabot.
I've come up with a satisfying workaround:
Define Dockerfile
in /src/test/resources/
:
FROM localstack/localstack:x.y.z
then, point Dependabot to Dockerfile
:
dependabot.yml:
- package-ecosystem: docker
directory: "/src/test/resources/Dockerfile"
schedule:
interval: daily
In tests, I made an utility to get version:
fun readVersionFromDockerfile() = this.javaClass.getResource("/Dockerfile")!!
.readText()
.lines()
.first()
.substringAfter(":")
}
And use the parsed version in tests.