mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Merge pull request #332 from hashbang/master
docker: Fix quoting that breaks some versions of Docker
This commit is contained in:
commit
b9d63b701d
1 changed files with 2 additions and 8 deletions
|
@ -50,15 +50,9 @@ class PopulateLabels(Task):
|
||||||
for label, value in info.manifest.provider['labels'].items():
|
for label, value in info.manifest.provider['labels'].items():
|
||||||
labels[label] = value.format(**info.manifest_vars)
|
labels[label] = value.format(**info.manifest_vars)
|
||||||
|
|
||||||
# pipes.quote converts newlines into \n rather than just prefixing
|
from pipes import quote
|
||||||
# it with a backslash, so we need to escape manually
|
|
||||||
def escape(value):
|
|
||||||
value = value.replace('"', '\\"')
|
|
||||||
value = value.replace('\n', '\\\n')
|
|
||||||
value = '"' + value + '"'
|
|
||||||
return value
|
|
||||||
for label, value in labels.items():
|
for label, value in labels.items():
|
||||||
info._docker['dockerfile'].append('LABEL {}={}'.format(label, escape(value)))
|
info._docker['dockerfile'].append('LABEL {}={}'.format(label, quote(value)))
|
||||||
|
|
||||||
|
|
||||||
class AppendManifestDockerfile(Task):
|
class AppendManifestDockerfile(Task):
|
||||||
|
|
Loading…
Add table
Reference in a new issue