diff --git a/lib/kitchen/driver/docker_cli.rb b/lib/kitchen/driver/docker_cli.rb index a23a845..91eb084 100644 --- a/lib/kitchen/driver/docker_cli.rb +++ b/lib/kitchen/driver/docker_cli.rb @@ -174,7 +174,7 @@ def docker_file # TODO: Support other distribution end end - Array(config[:environment]).each { |env, value| file << "ENV #{env}=#{value}" } + Array(config[:environment]).each { |env, value| file << "ENV #{env}=\"#{value}\"" } Array(config[:run_command]).each { |cmd| file << "RUN #{cmd}" } file.join("\n") end diff --git a/spec/kitchen/driver/docker_cli_spec.rb b/spec/kitchen/driver/docker_cli_spec.rb index d7ad3c5..4175b19 100644 --- a/spec/kitchen/driver/docker_cli_spec.rb +++ b/spec/kitchen/driver/docker_cli_spec.rb @@ -241,7 +241,7 @@ ret = "FROM ubuntu/12.04\n" ret << "RUN apt-get update\n" ret << "RUN apt-get -y install sudo curl tar\n" - ret << "ENV test=hoge\n" + ret << "ENV test=\"hoge\"\n" ret << "RUN test\n" ret << "RUN test2" expect(@docker_cli.send(:docker_file)).to eq ret