jenkins pipeline code to build docker images
On building the docker image, you need to have the docker daemon enabled.
You can also use the jib, a Google project, which creates images for your Java applications without the Docker daemon