diff --git a/kolla/common/config.py b/kolla/common/config.py old mode 100644 new mode 100755 index 7eb66075d9..b08de9eed0 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -205,6 +205,8 @@ _CLI_OPTS = [ cfg.StrOpt('template-override', help='Path to template override file'), cfg.StrOpt('logs-dir', help='Path to logs directory'), + cfg.BoolOpt('pull', default=True, + help='Attempt to pull a newer version of the base image.'), ] _BASE_OPTS = [ diff --git a/kolla/image/build.py b/kolla/image/build.py index fde63e6a01..35029f198b 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -401,7 +401,7 @@ class BuildTask(DockerTask): tar.add(plugins_path, arcname='plugins') # Pull the latest image for the base distro only - pull = True if image.parent is None else False + pull = self.conf.pull if image.parent is None else False buildargs = self.update_buildargs() try: diff --git a/releasenotes/notes/docker-build-nopull-base-a860d046b9059cfc.yaml b/releasenotes/notes/docker-build-nopull-base-a860d046b9059cfc.yaml new file mode 100644 index 0000000000..957165af1d --- /dev/null +++ b/releasenotes/notes/docker-build-nopull-base-a860d046b9059cfc.yaml @@ -0,0 +1,6 @@ +--- +features: + - Add --pull/--nopull parameter for kolla-build, when --nopull is given and + the base image is already loaded, The docker-engine will not attempt to + pull a newer version of the image. This makes sense when the registry + server of base images is unreachable.