Hey @Nishant, you can use something like this in your pipeline and in pull the docker image in your Dockerfile.
agent {
// Equivalent to "docker build -f Dockerfile.build --build-arg version=1.0.2 ./build/
dockerfile {
filename 'Dockerfile.build'
dir 'build'
label 'my-defined-label'
additionalBuildArgs '--build-arg version=1.0.2'
}
}
Basically, when you use agent as Dockerfile, it assumes that it has to execute the dockerfile. In the filename parameter specify the dockerfile name, in dir mention the directory, add a label to it using label.