Class: Kitchen::Driver::Dockerwin
- Inherits:
-
Base
- Object
- Base
- Kitchen::Driver::Dockerwin
- Defined in:
- lib/kitchen/driver/dockerwin.rb
Overview
DockerWindows - Windows Containers via Docker
Instance Method Summary collapse
- #create(state) ⇒ Object
- #destroy(state) ⇒ Object
-
#finalize_config!(instance) ⇒ Object
Force the driver to use the Dockercli transport.
Instance Method Details
#create(state) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/kitchen/driver/dockerwin.rb', line 14 def create(state) run_command("docker pull #{instance.driver[:image]}") unless config[:skip_pull] = config[:mount_options] || "type=bind,source=\"#{ENV['TEMP']}\",target=\"#{ENV['TEMP']},readonly\"" container_id = run_command("docker run -idt --mount #{} --name #{instance.name} #{instance.driver[:image]}").strip state[:container_id] = container_id end |
#destroy(state) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# 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 |