Why not use one of the openjdk 18 liberica images? They produce the smallest containers and they are TCK-verified for Java SE specifications. You could find more at their dockerhub page.
P.S. One of my other answers and that question itself could also come in handy. That was about JDK 11 but it has some details that are still relevant if you want it to be as lightweight as possible.