further update: after lot of digging, i found that whatever environment variables set in Dockerfile (actually in image created using this dockerfile) are not available in build section using docker plugin .
but in reality , we need these variables to be available in the build section. In typical use case, lets say i am installing oracle JDK 8, and in the base image in dockerfile, already openjdk is installed. in order to use the oracle jdk, will set the environment variable and set the default jdk to oracle 8 I did that in Dockerfile and i am able to access java version manually if i try to build the image and run in container however, if the same dockerfile built using docker plugin , then those env variables are not available in build section is it by design ?? is there any way where we can allow these variables to be available in build section ??? Regards On Sun, Nov 1, 2015 at 3:10 AM, Irfan Sayed <[email protected]> wrote: > Hello, > > I tried using docker plugin. I have choose the option : Pull docker image > from repository > I have built the entire image and pushed it to private docker registry. > Using Jenkins job and i am able to pull the image. > > now my assumption is , whatever setting i have done while creating the > image should be available / intact when i am pulling image from docker > registry > but , in reality , it is not happening . > I have configured maven while creating image but now when i am pulling > image from registry, jenkins is not able to find mvn command line > now, i am not getting what is missing > > Manually, if i try to run that image in container, then i am getting mvn > command line > > please help > > Regards > > > On Sat, Oct 31, 2015 at 6:41 AM, Pradeep Kumar Mantha < > [email protected]> wrote: > >> Even I see the same problem as Irfan, Here we are not expecting >> environment variables from Jenkins. >> We expect whatever the variables/path set in docker file to be available >> to the build script. But currently the variables are being overwritten with >> the jenkins build environment variables, which seems to be incorrect. >> >> >> On Tuesday, October 27, 2015 at 11:25:51 PM UTC-7, Irfan Sayed wrote: >> >>> Hi All, >>> >>> I am using cloudbeese custom build environment plugin to create the >>> build environment based on docket container >>> I have created dockerfile and spawning image using container. >>> In the docker file , i am installing oracle JDK and setting up path >>> JAVA_HOME. >>> >>> However, after building docker image and executing it in docker >>> container through Jenkins job, I am not getting PATH variable updated which >>> i set in the docker file >>> >>> I executed "java -version" command as a build step and it is showing >>> some old version rather than the version which i set through dockerfile >>> >>> I feel that , the issue is similar to JENKINS-30113 >>> >>> can someone please suggest >>> >>> Regards >>> Irfan >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Jenkins Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-users/d57820c9-db3d-4561-b3b8-dece85293e0f%40googlegroups.com >> <https://groups.google.com/d/msgid/jenkinsci-users/d57820c9-db3d-4561-b3b8-dece85293e0f%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CACGLCJYMtJSpPAfomX%3DOev%2Bzo%3D94oP8Dr2cei5Rdqc%3D3gXK%2BDg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
