We're using s2i to build docker images using 2 images builder image & runtime image.

In some cases I don't need to build a docker image, I need just to run s2i build so that mvn will be executed what is coded inside the assemble script. Then I just need to get access to target directory. I can do similar steps via docker run and mounting volume then executing mvn and as it was as a volume I can grab the required build output files. When I do this via s2i I do not have target folder as the source code copied to the newly created container. I tried to add --volume $(pwd):/tmp/src/:z but it also fails. How I can get access to the build output(target) directory after s2i executed?

1

There are 1 best solutions below

0
On

I'm using workaroung which is

docker run --volume $(pwd):/tmp/src ... image /bin/bash -c "cd /tmp/src && /path/assemble"

Not ideal but does what I need and I have access to all files in target directory.