declarative: how can agent { docker { image 'foo:latest' }} really get the latest version?

26 views
Skip to first unread message

Matt Stave

unread,
May 19, 2017, 1:30:28 PM5/19/17
to Jenkins Users
If you run such a job the 1st time, all is well.
If you run it again, it may or may not decide to grab the latest version vs. use the one it already has.

I'm not sure if it's finding it on the Jenkins master, or on a local worker.

In my case it's an image built and pushed to a local repo by another Jenkins job, but the job that wants to use it runs independently.

A workaround is to skip using agent to get the image, and do a docker pull (which WILL get the latest one), docker run inside a node{}, but that seems kludgey, as does some sort of agent .. docker:dind + docker.pull, docker.inside ...

If you're using the Docker plugin to have docker-based slaves (which we're not), there's a "pull strategy" config option that has a lovely-sounding "pull once and update latest" option, fwiw.

Andrew Bayer

unread,
May 24, 2017, 8:47:56 AM5/24/17
to jenkins...@googlegroups.com
It's running on the agent. If the behavior here is wrong, please do open a JIRA. Thanks!


A.

--
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/9fbf5c04-4a34-4007-b2c4-3fbeb08ed872%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages