class Barbeque::DockerImage

Constants

DEFAULT_TAG

Attributes

registry[R]
repository[R]
tag[RW]

Public Class Methods

new(str) click to toggle source
# File lib/barbeque/docker_image.rb, line 5
def initialize(str)
  # See: https://github.com/docker/docker/blob/v1.10.2/image/spec/v1.md
  result = str.match(%r{((?<registry>[^/]+)?/)?(?<repository>[\w./-]+)(:(?<tag>[\w.-]+))?\z})
  @repository = result[:repository]
  @tag        = result[:tag] || DEFAULT_TAG
  @registry   = result[:registry] || ENV['BARBEQUE_DOCKER_REGISTRY']
end

Public Instance Methods

to_s() click to toggle source
# File lib/barbeque/docker_image.rb, line 16
def to_s
  [registry, "#{repository}:#{tag}"].compact.join('/')
end