Change order of priority to set the container Docker image
1. `testing` if the project has the feature flag
2. defined by the user in YAML file
3. set by `project.container_image` if an admin override it
The image used will be the last one that it's true following that order.
@@ -729,15 +729,15 @@ class DockerBuildEnvironment(BuildEnvironment):
)
# Decide what Docker image to use, based on priorities:
- # Use the Docker image set by user or,
+ # Use the Docker image set by our feature flag: ``testing`` or,
+ if self.project.has_feature(Feature.USE_TESTING_BUILD_IMAGE):
+ self.container_image = 'readthedocs/build:testing'
+ # the image set by user or,
if self.config and self.config.build.image:
self.container_image = self.config.build.image
- # the image overridden by the project (manually set by an admin) or,
+ # the image overridden by the project (manually set by an admin).
if self.project.container_image:
self.container_image = self.project.container_image
- # ``testing`` image if the project has this feature flag
- if self.project.has_feature(Feature.USE_TESTING_BUILD_IMAGE):
- self.container_image = 'readthedocs/build:testing'
if self.project.container_mem_limit:
self.container_mem_limit = self.project.container_mem_limit
