I have the same problem. We have other group producing the container image regularly, and we want to use "latest" tag instead of keep updating the config for a specific version.
We look at the code, there is a logic to determine if it should pull an image:
if (forcePull || !docker.hasImage(expandedImage)) {
boolean pulled = docker.pullImage(expandedImage)
}
and the hasImage() is actually calling "docker inspect" to see if it's returning a "0" status, assuming if the inspect is successful, the image exist and skip the pull altogether.
Isn't it we don't even need this hasImage() check and just call docker pull regardless? the docker pull is more intelligent to distinguish if it needs to pull an image or not because it's using hash.
This way, it will make the force pull unnecessary because the docker pull is smart enough. A better option is to have "skip pull" instead of "force pull" because in case people don't even want the docker pull to do the check-and-pull.
I have the same problem. We have other group producing the container image regularly, and we want to use "latest" tag instead of keep updating the config for a specific version.
We look at the code, there is a logic to determine if it should pull an image:
if (forcePull || !docker.hasImage(expandedImage)) {
boolean pulled = docker.pullImage(expandedImage)
}
and the hasImage() is actually calling "docker inspect" to see if it's returning a "0" status, assuming if the inspect is successful, the image exist and skip the pull altogether.
Isn't it we don't even need this hasImage() check and just call docker pull regardless? the docker pull is more intelligent to distinguish if it needs to pull an image or not because it's using hash.
This way, it will make the force pull unnecessary because the docker pull is smart enough. A better option is to have "skip pull" instead of "force pull" because in case people don't even want the docker pull to do the check-and-pull.