Skip to content
Snippets Groups Projects
Commit 070bf258 authored by Jeffrey Zhang's avatar Jeffrey Zhang
Browse files

Support a custom base image

Add a new option(base-image) to support custom base image
In default, the base-image is equal to base. When using custom
image, please use command line like:

    ./tool/build.py --base-image my-image --base centos --base-tag 0.1

DocImpact

Closes-Bug: #1573544
Change-Id: If4b9c57a2b68f6f06d3e981f30b2173064e02193
parent fcdf1873
No related branches found
No related tags found
No related merge requests found
FROM {{ base_distro }}:{{ base_distro_tag }}
FROM {{ base_image }}:{{ base_distro_tag }}
MAINTAINER {{ maintainer }}
LABEL kolla_version="{{ kolla_version }}"
......
......@@ -479,6 +479,7 @@ class KollaWorker(object):
loader=jinja2.FileSystemLoader(path))
template = env.get_template(template_name)
values = {'base_distro': self.base,
'base_image': self.conf.base_image,
'base_distro_tag': self.base_tag,
'install_metatype': self.install_metatype,
'image_prefix': self.image_prefix,
......
......@@ -56,10 +56,12 @@ _CLI_OPTS = [
cfg.StrOpt('base', short='b', default='centos',
choices=BASE_OS_DISTRO,
deprecated_group='kolla-build',
help='The base distro to use when building'),
help='The distro type of the base image'),
cfg.StrOpt('base-tag', default='latest',
deprecated_group='kolla-build',
help='The base distro image tag'),
cfg.StrOpt('base-image', default=None,
help='The base image name. Default is the same with base'),
cfg.BoolOpt('debug', short='d', default=False,
deprecated_group='kolla-build',
help='Turn on debugging log level'),
......@@ -288,3 +290,5 @@ def parse(conf, args, usage=None, prog=None,
prog=prog,
version=version.cached_version_string(),
default_config_files=default_config_files)
if not conf.base_image:
conf.base_image = conf.base
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment