How to force docker to pull image with every batch task execution?
The documentation for the container_run_options
input for the TaskContainerSettings
class [link] describe it as
These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service.
However, when I provide the --pull=always
option, I get the following error message from my batch compute node:
ContainerInvalidSettings: At least one value of specified task container settings is invalid
Message: Some supplied docker options are not recognized or are unsupported: --pull, always
As far as I'm aware, the --pull always option has been available for several years as a docker run/create option.
I've tried reaching out to support for this issue and I did not get much of an explanation as to why this setting does not work. What's even more confusing is if I SSH directly on to the compute node, I can use the --pull=always option.
How can I ensure that the latest docker image is pulled before the execution of of my command on the batch compute node? This is a concern for our development workflow as we tend to use the latest
tag, and if we have a long running batch compute node there is a risk it will use a stale image when creating the container.