Best practice on using gradle docker plugin within docker

I am successfully running compile and artifact publication jobs within docker. How would I go about using the gradle docker plugin within docker, building and pushing docker images with the artifacts I just built? The way I’ve tried the gradle docker plugin, docker itself must be running somewhere.

Is there a best practice on how to do that?