Skip to content

Commit

Permalink
Merge pull request #247 from seanmil/fix_docker_remote_host
Browse files Browse the repository at this point in the history
Fix docker remote host support
  • Loading branch information
LukasAud authored Jan 24, 2024
2 parents 23d7c5a + 7764983 commit 2660aaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def provision(image, inventory_location, vars)
begin
# Use the current docker context to determine the docker hostname
docker_context = JSON.parse(run_local_command('docker context inspect'))[0]
hostname = URI.parse(docker_context['Endpoints']['docker']['Host']).host || hostname
docker_uri = URI.parse(docker_context['Endpoints']['docker']['Host'])
hostname = docker_uri.host unless docker_uri.host.nil? || docker_uri.host.empty?
rescue RuntimeError
# old clients may not support docker context
end
Expand Down

0 comments on commit 2660aaf

Please sign in to comment.