I am working on Jenkins file which is pulling docker image and execute some command inside this docker image then after I want to save this image and push it into AWS ECR. in here execute commands inside a docker container and push the docker image to ECR part is working and have no clue about how to commit(save) updated docker image.
Excute commands inside
stage('Run inside Docker container') {
agent {
docker { image 'test/testimage:619c95b' }
}
steps {
sh 'ls & pwd & ps'
}
}
Save Docker image
???
Push to AWS ECR
steps {
script {
docker.withRegistry('https://xxxxxxxxxxx.dkr.ecr.us-east-2.amazonaws.com/', 'ecr:us-east-2:aws-xx-automation') {
image.push("${env.tag}")
}
}
}