def docker_url(options)
      if options[:host] || options[:port]
        host = options[:host] || DEFAULT_HOST
        port = options[:port] || DEFAULT_PORT
        "tcp://#{host}:#{port}"
      elsif path = options[:socket]
        "unix://#{path}"
      else
        nil
      end
    end
Private: Get the URL to use for communicating with Docker. If a host and/or
port a present, a TCP socket URL will be generated. Otherwise a Unix
socket will be used.

options - A Hash of options for building the URL.
:host   - The hostname or IP of a remote Docker daemon
(optional).
:port   - The TCP port of the remote Docker daemon (optional).
:socket - The path of a local Unix socket (optional).

Returns a String url.