From 8c61f3e2c494771a23f2649360c3f6528fbcfe73 Mon Sep 17 00:00:00 2001 From: Ian McLeod Date: Wed, 15 Jun 2016 22:26:23 -0500 Subject: [PATCH] remove xattrs settings for Docker tar - add parameter for future tweaking --- imagefactory_plugins/Docker/Docker.py | 14 ++++++++++++-- imagefactory_plugins/imagefactory-plugins.spec.in | 3 +++ imagefactory_plugins/setup.py | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/imagefactory_plugins/Docker/Docker.py b/imagefactory_plugins/Docker/Docker.py index e3b97179..ef34a9b4 100644 --- a/imagefactory_plugins/Docker/Docker.py +++ b/imagefactory_plugins/Docker/Docker.py @@ -330,8 +330,18 @@ def _run_guestmount(g): fuse_thread = threading.Thread(group=None, target=_run_guestmount, args=(guestfs_handle,)) fuse_thread.start() self.log.debug("Creating tar of entire image") - # Use acls and xattrs to ensure SELinux data is not lost - tarcmd = [ 'tar', '-cf', builder.target_image.data, '-C', tempdir, '--acls', '--xattrs' ] + # NOTE - we used to capture xattrs here but have reverted the change for now + # as SELinux xattrs break things in unexpected ways and the tar feature + # to allow selective inclusion is broken + # TODO: Follow up with tar maintainers and docker image creators to find out what + # if any xattrs we really need to capture here + tarcmd = [ 'tar', '-cf', builder.target_image.data, '-C', tempdir ] + # User may pass in a comma separated list of additional options to the tar command + tar_options = parameters.get('tar_options', None) + if tar_options: + tar_options_list=tar_options.split(',') + for option in tar_options_list: + tarcmd.append(option.strip()) # User may pass in a comma separated list of excludes to override this # Default to ./etc/fstab as many people have complained this does not belong in Docker images tar_excludes = parameters.get('tar_excludes', './etc/fstab').split(',') diff --git a/imagefactory_plugins/imagefactory-plugins.spec.in b/imagefactory_plugins/imagefactory-plugins.spec.in index a4d67bd0..591136aa 100644 --- a/imagefactory_plugins/imagefactory-plugins.spec.in +++ b/imagefactory_plugins/imagefactory-plugins.spec.in @@ -410,6 +410,9 @@ rm -rf %{buildroot}%{python_sitelib}/imagefactory_plugins/Nova %{python_sitelib}/imagefactory_plugins/HyperV/* %changelog +* Wed Jun 15 2016 Ian McLeod - 1.1.9-2 +- remove xattr saving in Docker tar file creation + * Tue May 31 2016 Ian McLeod - 1.1.9-1 - Upstream release 1.1.9 - Add HyperV Vagrant support diff --git a/imagefactory_plugins/setup.py b/imagefactory_plugins/setup.py index 5a7f382f..3f0bba87 100644 --- a/imagefactory_plugins/setup.py +++ b/imagefactory_plugins/setup.py @@ -30,7 +30,7 @@ 'OVA', 'Docker', 'Nova', 'HyperV'] VERSION = '1.1.9' -RELEASE = '1' +RELEASE = '2' class sdist(_sdist): """ custom sdist command, to prep imagefactory-plugins.spec file """