Docker Slave : saving artifacts

76 views
Skip to first unread message

Matthew Ceroni

unread,
Jun 10, 2016, 2:07:06 PM6/10/16
to Jenkins Users
Using a docker container as a slave to build RPM packages. 

My ideal setup would be to have one job build the RPM and then a dependent job upload the RPM to our internal repositories. However I haven't figured out yet how to get the RPM outside the container so other jobs can pick it up. Once the job finishes, the container is torn down.

Looking at the settings for the docker plugin the Remote Root FS setting and volume mapping seem to be what I would want, I use a volume mapping from ${WORKSPACE} to the /home/jenkins directory inside the container (as that is where the build is happening) but I don't think ${WORKSPACE} was expanded to its value as upon container creation it failed. 

nicolas de loof

unread,
Jun 10, 2016, 2:11:41 PM6/10/16
to jenkins...@googlegroups.com
Here is my way to do this :

I build the binary using docker and a build Dockerfile

then I create a container from resulting image and cp artifact from it into local working directory - you can't cp from image, so need to create a container, no need to start it, but need to create one

then I build a second docker image using a production Dockerfile, to include built artifact, and push to repo (maybe you don't need this step, if you don't use docker as target artifact)



--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f85895a6-87ab-4c4f-9931-9140837924a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages