How can I use an image built by kaniko in Jenkins pipeline? I want to build the image, use that image to run tests for my app, and then push the image. With docker that would look something like this:
steps {
container('docker') {
script {
myimage = docker.build('image:tag')
}
}
container('docker') {
script {
myimage.inside {
sh 'pipenv run test'
}
}
}
# and somewhere below I would use `docker.withRegistry('some registry') { myimage.push() }
}
I am not sure how to translate that part myimage.inside
from docker. With kaniko I have this:
steps {
container('kaniko') {
script {
sh '/kaniko/executor --tar-path=myimage.tar --context . --no-push --destination myregistry:tag'
}
}
container(???) {
# how can I use that image from above to run my tests??
}
# and somewhere below I use `crane` to push the image.
}
Not sure if this is relevant, but whole pipeline would run in kubernetes environment, thus I would want to avoid using docker in docker (DinD).