What is the best way to run a database introspection from a Docker build?

Hi!

I’m trying to build a Docker image for a Gradle JVM project that uses jOOQ to generate code classes from a database introspection. To do this we have a Gradle task jooqCodegenWithContainer.

This task uses Testcontainers to spin up a database instance, run migrations and finally generate the code.

I was looking to mount the Docker socket from my build to be able to spin up a sibling container to run the database in, but I don’t know if this is the best approach.

Any pointers? Thanks.

We ended up creating a database instance inside our CI workflow to use for migrations.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.