lib/kitchen/driver/docker.rb in kitchen-docker-0.2.0 vs lib/kitchen/driver/docker.rb in kitchen-docker-0.3.0

- old
+ new

@@ -32,10 +32,11 @@ default_config :platform, 'ubuntu' default_config :port, '22' default_config :username, 'kitchen' default_config :password, 'kitchen' default_config :require_chef_omnibus, true + default_config :remove_images, false def verify_dependencies run_command('docker > /dev/null', :quiet => true) rescue raise UserError, @@ -50,10 +51,12 @@ ensure_fqdn(state) end def destroy(state) rm_container(state) if state[:container_id] - rm_image(state) if state[:image_id] + if config[:remove_images] && state[:image_id] + rm_image(state) + end end protected def dockerfile