Class: Kitchen::Driver::Docker
Overview
Docker driver for Kitchen.
Instance Method Summary
collapse
#container_env_variables, #container_exec, #container_exists?, #container_ip_address, #copy_file_to_container, #create_dir_on_container, #dockerfile_path, #dockerfile_proxy_config, #dockerfile_template, #parse_container_id, #remote_socket?, #remove_container, #replace_env_variables, #run_container, #socket_uri
#build_copy_command, #build_env_variable_args, #build_exec_command, #build_powershell_command, #build_run_command, #config_to_options, #dev_null, #docker_command, #docker_shell_opts, #run_command
Instance Method Details
#create(state) ⇒ Object
120
121
122
123
124
|
# File 'lib/kitchen/driver/docker.rb', line 120
def create(state)
container.create(state)
wait_for_transport(state)
end
|
#default_image ⇒ Object
136
137
138
139
140
141
142
|
# File 'lib/kitchen/driver/docker.rb', line 136
def default_image
platform, release = instance.platform.name.split("-")
if platform == "centos" && release
release = "centos" + release.split(".").first
end
release ? [platform, release].join(":") : platform
end
|
144
145
146
|
# File 'lib/kitchen/driver/docker.rb', line 144
def default_platform
instance.platform.name.split("-").first
end
|
#destroy(state) ⇒ Object
126
127
128
|
# File 'lib/kitchen/driver/docker.rb', line 126
def destroy(state)
container.destroy(state)
end
|
#verify_dependencies ⇒ Object
114
115
116
117
118
|
# File 'lib/kitchen/driver/docker.rb', line 114
def verify_dependencies
run_command("#{config[:binary]} >> #{dev_null} 2>&1", quiet: true, use_sudo: config[:use_sudo])
rescue
raise UserError, "You must first install the Docker CLI tool https://www.docker.com/get-started"
end
|
#wait_for_transport(state) ⇒ Object
130
131
132
133
134
|
# File 'lib/kitchen/driver/docker.rb', line 130
def wait_for_transport(state)
if config[:wait_for_transport]
instance.transport.connection(state, &:wait_until_ready)
end
end
|