- 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:
parent
e902cd62fd
commit
fa55169c35
2 changed files with 4 additions and 3 deletions
|
@ -132,7 +132,6 @@ class ACIImage(TarImageFormatter):
|
||||||
""" Builds an ACI manifest from the docker layer data. """
|
""" Builds an ACI manifest from the docker layer data. """
|
||||||
|
|
||||||
config = docker_layer_data.get('config', {})
|
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'],
|
source_url = "%s://%s/%s/%s:%s" % (app.config['PREFERRED_URL_SCHEME'],
|
||||||
app.config['SERVER_HOSTNAME'],
|
app.config['SERVER_HOSTNAME'],
|
||||||
|
@ -140,7 +139,8 @@ class ACIImage(TarImageFormatter):
|
||||||
|
|
||||||
# ACI requires that the execution command be absolutely referenced. Therefore, if we find
|
# 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.
|
# 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('/'):
|
if exec_path and not exec_path[0].startswith('/'):
|
||||||
exec_path = ['/bin/sh', '-c', '""%s""' % ' '.join(exec_path)]
|
exec_path = ['/bin/sh', '-c', '""%s""' % ' '.join(exec_path)]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import tarfile
|
import tarfile
|
||||||
|
import copy
|
||||||
|
|
||||||
class TarLayerReadException(Exception):
|
class TarLayerReadException(Exception):
|
||||||
""" Exception raised when reading a layer has failed. """
|
""" Exception raised when reading a layer has failed. """
|
||||||
|
@ -38,7 +39,7 @@ class TarLayerFormat(object):
|
||||||
|
|
||||||
# Yield the tar header.
|
# Yield the tar header.
|
||||||
if self.path_prefix:
|
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)
|
clone.name = os.path.join(self.path_prefix, clone.name)
|
||||||
yield clone.tobuf()
|
yield clone.tobuf()
|
||||||
else:
|
else:
|
||||||
|
|
Reference in a new issue