How to force docker to pull image with every batch task execution?

Nick Holt 5 Reputation points
2023-03-10T18:45:39.5633333+00:00

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.

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
384 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
930 questions
Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
301 questions
{count} votes