aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-29 07:50:30 +0000
committerGerrit Code Review <review@openstack.org>2016-11-29 07:50:30 +0000
commit044a6afffcacae6680d964c8b28857c6945e4b95 (patch)
tree96ca74bfcf423d6d5d511bca2377b8ea8b112528
parent6aa5cd7d98bf58853548cf18bf58654f34ad082e (diff)
parent661f2a45c26de322000ac6739bb1cea9c4b761d6 (diff)
downloadkolla-044a6afffcacae6680d964c8b28857c6945e4b95.tar.gz
kolla-044a6afffcacae6680d964c8b28857c6945e4b95.zip
Merge "Remove --include-header and --include-footer parameter"
-rw-r--r--doc/image-building.rst31
-rw-r--r--kolla/common/config.py12
-rwxr-xr-x[-rw-r--r--]kolla/image/build.py8
-rw-r--r--releasenotes/notes/remove-include-header-footer-parameters-68a6374635a8c9b0.yaml6
4 files changed, 13 insertions, 44 deletions
diff --git a/doc/image-building.rst b/doc/image-building.rst
index a4ce5bb2d..96a14e07a 100644
--- a/doc/image-building.rst
+++ b/doc/image-building.rst
@@ -145,21 +145,14 @@ the best use of the docker cache.
type = local
location = /tmp/ironic.tar.gz
-To build RHEL containers, it is necessary to use the ``-i`` (include header)
-feature to include registration with RHN of the container runtime operating
-system. To obtain a RHN username/password/pool id, contact Red Hat.
-
-First create a file called ``rhel-include``:
-
-::
+To build RHEL containers, it is necessary to include registration with RHN
+of the container runtime operating system. To obtain a RHN
+username/password/pool id, contact Red Hat. Use a template's header block
+overrides file, add the following::
RUN subscription-manager register --user=<user-name> --password=<password> \
&& subscription-manager attach --pool <pool-id>
-Then build RHEL containers::
-
- kolla-build -b rhel -i ./rhel-include
-
Dockerfile Customisation
========================
@@ -371,32 +364,22 @@ insecure registry. See
Building behind a proxy
-----------------------
-The build script supports augmenting the Dockerfiles under build via so called
-`header` and `footer` files. Statements in the `header` file are included at
-the top of the `base` image, while those in `footer` are included at the bottom
-of every Dockerfile in the build.
-
-A common use case for this is to insert http_proxy settings into the images to
+We can insert http_proxy settings into the images to
fetch packages during build, and then unset them at the end to avoid having
them carry through to the environment of the final images. Note however, it's
not possible to drop the info completely using this method; it will still be
visible in the layers of the image.
-To use this feature, create a file called ``.header``, with the following
-content for example::
+To set the proxy settings, we can add this to the template's header block::
ENV http_proxy=https://evil.corp.proxy:80
ENV https_proxy=https://evil.corp.proxy:80
-Then create another file called ``.footer``, with the following content::
+To unset the proxy settings, we can add this to the template's footer block::
ENV http_proxy=""
ENV https_proxy=""
-Finally, pass them to the build script using the ``-i`` and ``-I`` flags::
-
- kolla-build -i .header -I .footer
-
Besides this configuration options, the script will automatically read these
environment variables. If the host system proxy parameters match the ones
going to be used, no other input parameters will be needed. These are the
diff --git a/kolla/common/config.py b/kolla/common/config.py
index b5f00d6b9..42c4b3ae4 100644
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -76,18 +76,6 @@ _CLI_OPTS = [
help='Turn on debugging log level'),
cfg.DictOpt('build-args',
help='Set docker build time variables'),
- cfg.StrOpt('include-header', short='i',
- deprecated_for_removal=True,
- deprecated_reason=('Use a header block within a template'
- ' overrides file instead'),
- help=('Path to custom file to be added at '
- 'beginning of base Dockerfile')),
- cfg.StrOpt('include-footer', short='I',
- deprecated_for_removal=True,
- deprecated_reason=('Use a footer block within a template'
- ' overrides file instead'),
- help=('Path to custom file to be added at '
- 'end of Dockerfiles for final images')),
cfg.BoolOpt('keep', default=False,
help='Keep failed intermediate containers'),
cfg.BoolOpt('list-dependencies', short='l',
diff --git a/kolla/image/build.py b/kolla/image/build.py
index 55ff7a11e..f84193be5 100644..100755
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -526,8 +526,6 @@ class KollaWorker(object):
self.image_prefix = self.base + '-' + self.install_type + '-'
- self.include_header = conf.include_header
- self.include_footer = conf.include_footer
self.regex = conf.regex
self.image_statuses_bad = dict()
self.image_statuses_good = dict()
@@ -669,12 +667,6 @@ class KollaWorker(object):
env.filters.update(self._get_filters())
env.globals.update(self._get_methods())
template = env.get_template(template_name)
- if self.include_header:
- with open(self.include_header, 'r') as f:
- values['include_header'] = f.read()
- if self.include_footer:
- with open(self.include_footer, 'r') as f:
- values['include_footer'] = f.read()
content = template.render(values)
content_path = os.path.join(path, 'Dockerfile')
with open(content_path, 'w') as f:
diff --git a/releasenotes/notes/remove-include-header-footer-parameters-68a6374635a8c9b0.yaml b/releasenotes/notes/remove-include-header-footer-parameters-68a6374635a8c9b0.yaml
new file mode 100644
index 000000000..86008cb45
--- /dev/null
+++ b/releasenotes/notes/remove-include-header-footer-parameters-68a6374635a8c9b0.yaml
@@ -0,0 +1,6 @@
+---
+upgrade:
+ - The --include-header and --include-footer parameters were deprecated
+ as of the Newton release. They should be move use header and footer
+ block in template overrides file. The two parameters are removed in
+ the Ocata-release.