Chapter 09/circuit-oneops-1-master/components/cookbooks/docker_engine/libraries/docker_util.rb
# Initialize docker remote client. Make sure to install docker
# remote API gem (::add_docker_gem) before invoking this method.
#
Initialize docker remote client. Make sure to install docker
remote API gem (::add_docker_gem) before invoking this method.
Initialize docker remote client . Make sure to install docker remote API gem ( :: add_docker_gem ) before invoking this method .
def init_docker_client()
      begin
        require 'docker'
        Chef::Log.info("Connecting to docker daemon on #{Docker.url}")
        if node.docker_engine.tlsverify == 'true'
          Chef::Log.info('Configuring docker TLS options.')
          Docker.url ='tcp://0.0.0.0:2376'
          Docker.options = {
              client_cert: node.docker_engine.tlscert_file,
              client_key: node.docker_engine.tlskey_file,
              ssl_ca_file: node.docker_engine.tlscacert_file,
              scheme: 'https'
          }
        end
        Docker.validate_version!
      rescue Exception => e
        Chef::Log.error(e)
        exit_with_err("Docker client initialization failed, #{e.message}")
      end
    end
def init_docker_client ( ) begin require 'docker' Chef :: Log . info ( "Connecting to docker daemon on #{Docker.url}" ) if node . docker_engine . tlsverify == 'true' Chef :: Log . info ( 'Configuring docker TLS options.' ) Docker . url = 'tcp://0.0.0.0:2376' Docker . options = { client_cert : node . docker_engine . tlscert_file , client_key : node . docker_engine . tlskey_file , ssl_ca_file : node . docker_engine . tlscacert_file , scheme : 'https' } end Docker . validate_version! rescue Exception => e Chef :: Log . error ( e ) exit_with_err ( "Docker client initialization failed, #{e.message}" ) end end
Initialize docker remote client.
Initialize docker remote client .