class Kitchen::Driver::Dockerwin
DockerWindows - Windows Containers via Docker
Public Instance Methods
create(state)
click to toggle source
# File lib/kitchen/driver/dockerwin.rb, line 14 def create(state) run_command("docker pull #{instance.driver[:image]}") unless config[:skip_pull] mount_options = config[:mount_options] || "type=bind,source=\"#{ENV['TEMP']}\",target=\"#{ENV['TEMP']},readonly\"" container_id = run_command("docker run -idt --mount #{mount_options} --name #{instance.name} #{instance.driver[:image]}").strip state[:container_id] = container_id end
destroy(state)
click to toggle source
# File lib/kitchen/driver/dockerwin.rb, line 21 def destroy(state) return if state[:container_id].nil? container_id = state[:container_id] info 'Killing container' run_command("docker kill #{container_id} > nul") info 'Removing container' run_command("docker rm #{container_id} > nul") state.delete(:container_id) end
finalize_config!(instance)
click to toggle source
Force the driver to use the Dockercli transport
Calls superclass method
# File lib/kitchen/driver/dockerwin.rb, line 32 def finalize_config!(instance) super.tap do instance.transport = Kitchen::Transport::Dockercli.new end end