Sha256: 593e0fd08857b23424f8a8cb9d070c397550758d7868f3524f34e18e494fc943
Contents?: true
Size: 483 Bytes
Versions: 56
Compression:
Stored size: 483 Bytes
Contents
module Kubes::Compiler::Dsl::Core module Helpers def dockerfile_port path = "#{Kubes.root}/Dockerfile" File.exist?(path) ? parse_for_dockerfile_port(path) : 80 end private def parse_for_dockerfile_port(path) lines = IO.read(path).split("\n") expose_line = lines.find { |l| l =~ /^EXPOSE / } if expose_line md = expose_line.match(/EXPOSE (\d+)/) port = md[1] if md end port ? port.to_i : 80 end end end
Version data entries
56 entries across 56 versions & 1 rubygems