Persistent docker build agents

35 views
Skip to first unread message

Matej Drobnič

unread,
Jul 25, 2019, 5:56:18 AM7/25/19
to Jenkins Users
Hello,

I'm wondering if there is a way to dynamically provision jenkins build agents via docker, but have them persist their state (e.g. reuse existing containers whenever possible instead of creating new ones)?

Docker plugin appears to be closest to this, but it always destroys old containers and creates fresh one.

Main reason for doing that would be gradle's inability to share download cache between projects. So instead of having one global download cache which is not supported by Gradle, every agent would have its own download cache that would be persisted between builds.

Thanks.

Slide

unread,
Jul 25, 2019, 6:12:31 AM7/25/19
to Jenkins User Mailing List
Isn't that what volumes are for?

--
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/2ce561d6-ab1e-412a-9d80-9a271a1c3d2a%40googlegroups.com.


--

Matej

unread,
Jul 25, 2019, 6:49:04 AM7/25/19
to jenkins...@googlegroups.com
Yes, but since container is destroyed after every build by docker plugin I cannot assign a volume to a specific container.

Slide

unread,
Jul 25, 2019, 6:55:08 AM7/25/19
to Jenkins User Mailing List

Matej

unread,
Jul 25, 2019, 9:26:59 AM7/25/19
to jenkins...@googlegroups.com
Yes, I've read through that thread. Unfortunately all workarounds to that issue are very hacky.

Ivan Fernandez Calvo

unread,
Jul 25, 2019, 3:45:08 PM7/25/19
to Jenkins Users
You can mount a lo cal folder work in it, then when your Docker container finished you would have the results, then create a new Docker image with the results into it or push that data to a S3 bucket or similar, in that way you would have the data or in the Docker image or in a S3 bucket where you can restore it wherever you want
Reply all
Reply to author
Forward
0 new messages