Module: QB::Util::DockerMixin

Included in:
Package::Version
Defined in:
lib/qb/util/docker_mixin.rb

Overview

Mixin to help working with Docker.

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

DOCKER_TAG_MAX_CHARACTERS =

Character limit for Docker image tags.

Returns:

  • (Fixnum)
128
DOCKER_TAG_VALID_RE =

Regexp to validate strings as Docker tags:

  1. Must start with an ASCII alpha-numeric - A-Z, a-z, 0-9.

  2. The rest of the characters can be:

    1. A-Z
    2. a-z
    3. _
    4. .
    5. -

    Note that it can not include +, so Semver strings with build info after the + are not legal.

  3. Must be DOCKER_TAG_MAX_CHARACTERS in length or less.

Returns:

  • (Regexp)
/\A[A-Za-z0-9_][A-Za-z0-9_\.\-]{0,#{ DOCKER_TAG_MAX_CHARACTERS - 1}}\z/.
freeze

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

module ClassMethods



123
124
125
# File 'lib/qb/util/docker_mixin.rb', line 123

def self.included base
  base.extend ClassMethods
end