Note the name attribute for the ContainerDefinition
element should be the same name as specified for the
dockerContainerDefinitionName attribute specified in the previous step (for
example, ABC).
Use the retryLimit attribute to specify the number of times the Docker
client will retry pulling a Docker image, if it cannot pull the image. If the number of attempts
exceeds this value, the system will stop starting the Docker container. Valid values are any
positive integer from 0 to 2147483647. The default is 0, meaning that the Docker
client only pulls once, and does not retry if it is unsuccessful. If you specify an unsupported
value for the retryLimit attribute in the application profile, registering the
application will be rejected. If you do not specify a value, the default will be used instead.
Use the retryInterval attribute to specify the number of seconds to wait
before the Docker client attempts to re-pull the Docker image, if the previous pull failed. Valid
values are any positive integer from 0 to 2147483647. The default is 3 seconds. If
you specify an unsupported value for the retryInterval attribute in the
application profile, registering the application will be rejected. If you do not specify a value,
the default will be used instead.
For example:
<Docker>
<ContainerDefinition containerUser="root" imageName="docker.io/ubuntu:14.04" name="ABC">
<ImagePull retryLimit="3" retryInterval="60"/>
</ContainerDefinition>
</Docker>
Note: This Docker image pulling feature interacts with
the
IBM Spectrum Symphony timeout
duration for service instances feature (for the Register method), which is defined in the
Service section of the
application profile, under
:
<Method name="Register">
<Timeout actionOnSI="blockHost" duration="60"/>
<Exit actionOnSI="blockHost"/>
</Method>
If
the service instance register timeout duration is triggered when the Docker client is pulling a
Docker image, the client will stop pulling the image, and any remaining Docker image pull retries
will be ignored because the service instance register timeout duration started before Docker image
pulling started.
Take, for example, a service instance register timeout duration of 60 seconds
(duration="60"
in the Service section of the application profile), a Docker image
pull retry limit of 9 retries (retryLimit=9
in the Docker section of the
application profile), and a Docker image pull retry wait interval of 10 seconds
(retryInterval=10
). The duration timer starts immediately after SIM starts the
Docker controller. Upon unsuccessfully pulling the Docker image, the system waits 10 seconds
(retryInterval=10
), and then retries to pull the image again, using the retry
attempt 1, then retry 2, and then up until retry 5. After 60 seconds
(duration="60"
), the Docker controller will be terminated, and therefore, not allow
retries 6 to 9 to be executed. The service instance register timeout of 60 seconds triggered first,
and therefore ended before the system could attempt retries 6 to 9.