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)

sample here :
https://github.com/cfpio/callForPapers/blob/master/Jenkinsfile.sh


2016-06-10 20:07 GMT+02:00 Matthew Ceroni <[email protected]>:

> 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.
>
> --
> 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/f85895a6-87ab-4c4f-9931-9140837924a2%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/f85895a6-87ab-4c4f-9931-9140837924a2%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/CANMVJzmQDgNsWNcP%2BBtU4iqOLx9_Vyr99RY%3D9%2BDx76fK4ROQqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to