The docker image has an "entrypoint" that sources in a script to setup for a cross compiler (yocto environment script). I can use this image outside of Jenkins with no issue to run make, compilation, etc. as the environment is setup correctly by the entrypoint sourcing the script. This docker image is based off
When I try to use this docker image in Jenkins to perform a build, the environment is not setup. Jenkins starts a detached container that stays running in the background from the image and then uses what I assume to be "docker exec" equivalent to execute the steps in the container. Unfortunately when done this way, the environment that was setup by the "entrypoint" is not in effect.
The environment that is setup through sourcing the yocto environment script is not easily replicated by using the ENV command of the Dockerfile and it changes depending on yocto build and will become maintenance issue if I try to do so. So my question is, is there some way to get this environment script sourced so that the pipeline steps will have the environment that I don't know about? A second question, is the "sh './shellscript.sh' above actually doing something like
docker exec -t <container> sh -c ./shellscript.sh
Or is it doing
docker exec -t <container> ./shellscript.sh
I believe Jenkins is using docker in this fashion to start the container once for the duration of the stage and then execute the steps using the "docker exec" but this really does have an issue with it bypassing the carefully constructed "entrypoint" that might exist for the image.