Skip to content

Commit

Permalink
remove xattrs settings for Docker tar - add parameter for future twea…
Browse files Browse the repository at this point in the history
…king
  • Loading branch information
imcleod committed Jun 16, 2016
1 parent 5d9fed8 commit 8c61f3e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
14 changes: 12 additions & 2 deletions imagefactory_plugins/Docker/Docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(',')
Expand Down
3 changes: 3 additions & 0 deletions imagefactory_plugins/imagefactory-plugins.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ rm -rf %{buildroot}%{python_sitelib}/imagefactory_plugins/Nova
%{python_sitelib}/imagefactory_plugins/HyperV/*

%changelog
* Wed Jun 15 2016 Ian McLeod <[email protected]> - 1.1.9-2
- remove xattr saving in Docker tar file creation

* Tue May 31 2016 Ian McLeod <[email protected]> - 1.1.9-1
- Upstream release 1.1.9
- Add HyperV Vagrant support
Expand Down
2 changes: 1 addition & 1 deletion imagefactory_plugins/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down

0 comments on commit 8c61f3e

Please sign in to comment.