lib/kitchen/driver/docker.rb in kitchen-docker-1.0.0.beta vs lib/kitchen/driver/docker.rb in kitchen-docker-1.0.0

- old
+ new

@@ -26,10 +26,11 @@ # @author Sean Porter <portertech@gmail.com> class Docker < Kitchen::Driver::SSHBase default_config :socket, 'unix:///var/run/docker.sock' default_config :privileged, false + default_config :use_cache, true default_config :remove_images, false default_config :run_command, '/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no' default_config :username, 'kitchen' default_config :password, 'kitchen' @@ -143,10 +144,12 @@ raise ActionFailed, 'Could not parse Docker build output for image ID' end def build_image(state) - output = docker_command("build -", :input => dockerfile) + cmd = "build" + cmd << " --no-cache" unless config[:use_cache] + output = docker_command("#{cmd} -", :input => dockerfile) parse_image_id(output) end def parse_container_id(output) container_id = output.chomp