- Fix bug in tarlayerformat when dealing with larger headers

- Fix bug around entry points and config in the ACI converter
This commit is contained in:
Joseph Schorr 2015-01-16 18:23:40 -05:00
parent e902cd62fd
commit fa55169c35
2 changed files with 4 additions and 3 deletions

View file

@ -132,7 +132,6 @@ class ACIImage(TarImageFormatter):
""" Builds an ACI manifest from the docker layer data. """
config = docker_layer_data.get('config', {})
config.update(docker_layer_data.get('container_config', {}))
source_url = "%s://%s/%s/%s:%s" % (app.config['PREFERRED_URL_SCHEME'],
app.config['SERVER_HOSTNAME'],
@ -140,7 +139,8 @@ class ACIImage(TarImageFormatter):
# ACI requires that the execution command be absolutely referenced. Therefore, if we find
# a relative command, we give it as an argument to /bin/sh to resolve and execute for us.
exec_path = config.get('Cmd', [])
entrypoint = config.get('Entrypoint') or []
exec_path = entrypoint + config.get('Cmd') or []
if exec_path and not exec_path[0].startswith('/'):
exec_path = ['/bin/sh', '-c', '""%s""' % ' '.join(exec_path)]

View file

@ -1,5 +1,6 @@
import os
import tarfile
import copy
class TarLayerReadException(Exception):
""" Exception raised when reading a layer has failed. """
@ -38,7 +39,7 @@ class TarLayerFormat(object):
# Yield the tar header.
if self.path_prefix:
clone = tarfile.TarInfo.frombuf(tar_info.tobuf())
clone = copy.deepcopy(tar_info)
clone.name = os.path.join(self.path_prefix, clone.name)
yield clone.tobuf()
else: