I have an Image A, which has a python file "main.py". I want to know how I can use Jenkins to run that file from a different pipeline. I want to use Jenkins to go inside that image and then run that file which is inside Image A.
I tried using .withRun but I don't think I'm doing this right.
docker.image(ImageA).withRun() {
sh "main.py ${parameters to pass}"
}
When I run it like this, it executes the local main.py that I have and executes that inside the container which isn't what I want. I want to execute the main.py that is already inside the container and pass in parameters.
Any ideas?
inside
command (see more info) which will execute your shell command inside the docker image using the local image files as you want. Something like:docker.image(ImageA).inside() {...}