I am using a Jenkins pipeline to build a Dockerfile.
The dockerfile successfully goes through all steps, and creates the docker image.
As shown:
<
None of the above ideas works for my case, and I finally got it work as below pipeline without chaning anything on Dockerfile:
def my_own_tag = "unknown"
my_own_tag = sh ( script: 'git tag | tail -n1', returnStdout: true ).trim()
docker_img = docker.build("latest")
docker_img.push("latest")
docker_img.push("${my_own_tag}")