diff --git a/lib/kitchen/transport/docker_cli.rb b/lib/kitchen/transport/docker_cli.rb index 9e0bd78..ba531e3 100644 --- a/lib/kitchen/transport/docker_cli.rb +++ b/lib/kitchen/transport/docker_cli.rb @@ -75,7 +75,7 @@ def docker_exec_command(container_id, cmd, opt = {}) exec_cmd = "exec" exec_cmd << " -t" if opt[:tty] exec_cmd << " -i" if opt[:interactive] - cmd = Util.wrap_command(cmd.gsub('\'', '"')) unless cmd.match(/\Ash\s\-c/) + cmd = Util.wrap_command(cmd.gsub("'", "'\\\\''")) unless cmd.match(/\Ash\s\-c/) exec_cmd << " #{container_id} #{cmd}" end