If you're giving copies to other people, that's distribution, which is dicey, but if you're making copies for your own use, that's reproduction, which is fine.
Distributing means giving the built artifact to a 3rd party.
Yes, you can create your own JDK docker base image. Yes, you can deploy it at will on any of your systems. No, you can't push it to a public respository for other people to use.