lib/kitchen/driver/docker.rb in kitchen-docker-2.2.0 vs lib/kitchen/driver/docker.rb in kitchen-docker-2.3.0
- old
+ new
@@ -64,10 +64,14 @@
driver.default_platform
end
default_config :disable_upstart, true
+ default_config :build_context do |driver|
+ !driver.remote_socket?
+ end
+
def verify_dependencies
run_command("#{config[:binary]} >> #{dev_null} 2>&1", :quiet => true)
rescue
raise UserError,
'You must first install the Docker CLI tool http://www.docker.io/gettingstarted/'
@@ -241,13 +245,15 @@
end
def build_image(state)
cmd = "build"
cmd << " --no-cache" unless config[:use_cache]
+ dockerfile_contents = dockerfile
+ build_context = config[:build_context] ? '.' : '-'
output = Tempfile.create('Dockerfile-kitchen-', Dir.pwd) do |file|
- file.write(dockerfile)
+ file.write(dockerfile_contents)
file.close
- docker_command("#{cmd} -f #{file.path} .")
+ docker_command("#{cmd} -f #{file.path} #{build_context}", :input => dockerfile_contents)
end
parse_image_id(output)
end
def parse_container_id(output)