diff --git a/paunch/builder/compose1.py b/paunch/builder/compose1.py index 882b92b..2f20b21 100644 --- a/paunch/builder/compose1.py +++ b/paunch/builder/compose1.py @@ -186,7 +186,7 @@ class ComposeV1Builder(object): if 'healthcheck' in cconfig: hconfig = cconfig['healthcheck'] if 'test' in hconfig: - cmd.append('--health-cmd=%s' % hconfig['test']) + cmd.append('--health-cmd="%s"' % hconfig['test']) if 'interval' in hconfig: cmd.append('--health-interval=%s' % hconfig['interval']) if 'timeout' in hconfig: diff --git a/paunch/tests/test_builder_compose1.py b/paunch/tests/test_builder_compose1.py index 1d310bc..99e2235 100644 --- a/paunch/tests/test_builder_compose1.py +++ b/paunch/tests/test_builder_compose1.py @@ -424,7 +424,7 @@ three-12345678 three''', '', 0), 'uts': 'host', 'restart': 'always', 'healthcheck': { - 'test': '/bin/true', + 'test': 'ls /mydir', 'interval': '30s', 'timeout': '10s', 'retries': 3 @@ -443,7 +443,7 @@ three-12345678 three''', '', 0), ['docker', 'run', '--name', 'one', '--detach=true', '--env-file=/tmp/foo.env', '--net=host', '--ipc=host', '--pid=container:bar', - '--uts=host', '--health-cmd=/bin/true', '--health-interval=30s', + '--uts=host', '--health-cmd="ls /mydir"', '--health-interval=30s', '--health-timeout=10s', '--health-retries=3', '--privileged=true', '--restart=always', '--user=bar', '--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}',