Sha256: 0204d17afb8a432f2554001bad2460ca80b59c5efac41d9981c9a248eb2a9c34

Contents?: true

Size: 616 Bytes

Versions: 22

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true

# takelage docker socket host
module DockerSocketHost
  # Backend method for docker socket host.
  def docker_socket_host
    log.debug 'Getting docker socket host ip address'

    socket_host = '127.0.0.1'

    addr_infos = Socket.getifaddrs

    # if interface docker0 exists (== linux host)
    # then return the ip address
    addr_infos.each do |addr_info|
      if addr_info.name == 'docker0'
        socket_host = addr_info.addr.ip_address if addr_info.addr.ipv4?
      end
    end

    log.debug "Docker socket host ip address is \"#{socket_host}\""

    socket_host
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
takelage-0.22.0 lib/takelage/docker/socket/host.rb
takelage-0.21.1 lib/takelage/docker/socket/host.rb
takelage-0.21.0 lib/takelage/docker/socket/host.rb
takelage-0.20.2 lib/takelage/docker/socket/host.rb
takelage-0.20.1 lib/takelage/docker/socket/host.rb
takelage-0.20.0 lib/takelage/docker/socket/host.rb
takelage-0.19.2 lib/takelage/docker/socket/host.rb
takelage-0.19.1 lib/takelage/docker/socket/host.rb
takelage-0.19.0 lib/takelage/docker/socket/host.rb
takelage-0.18.1 lib/takelage/docker/socket/host.rb
takelage-0.18.0 lib/takelage/docker/socket/host.rb
takelage-0.17.1 lib/takelage/docker/socket/host.rb
takelage-0.17.0 lib/takelage/docker/socket/host.rb
takelage-0.16.0 lib/takelage/docker/socket/host.rb
takelage-0.15.1 lib/takelage/docker/socket/host.rb
takelage-0.15.0 lib/takelage/docker/socket/host.rb
takelage-0.14.5 lib/takelage/docker/socket/host.rb
takelage-0.14.4 lib/takelage/docker/socket/host.rb
takelage-0.14.3 lib/takelage/docker/socket/host.rb
takelage-0.14.2 lib/takelage/docker/socket/host.rb