Fix ACI conversion handling of relative exec commands
This commit is contained in:
parent
6ed28930b2
commit
d8817a2965
1 changed files with 4 additions and 3 deletions
|
@ -136,10 +136,11 @@ class ACIImage(TarImageFormatter):
|
||||||
app.config['SERVER_HOSTNAME'],
|
app.config['SERVER_HOSTNAME'],
|
||||||
namespace, repository, tag)
|
namespace, repository, tag)
|
||||||
|
|
||||||
|
# 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', [])
|
exec_path = config.get('Cmd', [])
|
||||||
if exec_path:
|
if exec_path and not exec_path[0].startswith('/'):
|
||||||
if not exec_path[0].startswith('/'):
|
exec_path = ['/bin/sh', '-c', '""%s""' % ' '.join(exec_path)]
|
||||||
exec_path[0] = '/bin/' + exec_path[0]
|
|
||||||
|
|
||||||
# TODO: ACI doesn't support : in the name, so remove any ports.
|
# TODO: ACI doesn't support : in the name, so remove any ports.
|
||||||
hostname = app.config['SERVER_HOSTNAME']
|
hostname = app.config['SERVER_HOSTNAME']
|
||||||
|
|
Reference in a new issue