class Object
Public Instance Methods
print_info(guest_ip, port, secrets_path, machine_uuid)
click to toggle source
# File lib/command.rb, line 68 def print_info(guest_ip, port, secrets_path, machine_uuid) # Print configuration information for accesing the docker daemon # extending the .docker path to include secrets_path = File.expand_path(".docker", secrets_path) if !OS.windows? then message = <<-eos # Set the following environment variables to enable access to the # docker daemon running inside of the vagrant virtual machine: export DOCKER_HOST=tcp://#{guest_ip}:#{port} export DOCKER_CERT_PATH=#{secrets_path} export DOCKER_TLS_VERIFY=1 export DOCKER_MACHINE_NAME=#{machine_uuid[0..6]} # run following command to configure your shell: # eval "$(vagrant adbinfo)" eos @env.ui.info(message) else # replace / with \ for path in Windows secrets_path = secrets_path.split('/').join('\\') + '\\' message = <<-eos # Set the following environment variables to enable access to the # docker daemon running inside of the vagrant virtual machine: setx DOCKER_HOST tcp://#{guest_ip}:#{port} setx DOCKER_CERT_PATH #{secrets_path} setx DOCKER_TLS_VERIFY 1 setx DOCKER_MACHINE_NAME #{machine_uuid[0..6]} eos # puts is used here to escape and render the back slashes in Windows path @env.ui.info(puts(message)) end end