类 ImageReference

java.lang.Object
cn.taketoday.buildpack.platform.docker.type.ImageReference

public final class ImageReference extends Object
A reference to a Docker image of the form "imagename[:tag|@digest]".
从以下版本开始:
4.0
作者:
Phillip Webb, Scott Frederick, Moritz Halbritter
另请参阅:
  • 字段详细资料

    • JAR_VERSION_PATTERN

      private static final Pattern JAR_VERSION_PATTERN
    • LATEST

      private static final String LATEST
      另请参阅:
    • name

      private final ImageName name
    • tag

      private final String tag
    • digest

      private final String digest
    • string

      private final String string
  • 构造器详细资料

  • 方法详细资料

    • getDomain

      public String getDomain()
      Return the domain for this image name.
      返回:
      the domain
      另请参阅:
    • getName

      public String getName()
      Return the name of this image.
      返回:
      the image name
      另请参阅:
    • getTag

      public String getTag()
      Return the tag from the reference or null.
      返回:
      the referenced tag
    • getDigest

      public String getDigest()
      Return the digest from the reference or null.
      返回:
      the referenced digest
    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • toLegacyString

      public String toLegacyString()
    • buildString

      private String buildString(String name, String tag, String digest)
    • withDigest

      public ImageReference withDigest(String digest)
      Create a new ImageReference with an updated digest.
      参数:
      digest - the new digest
      返回:
      an updated image reference
    • inTaggedForm

      public ImageReference inTaggedForm()
      Return an ImageReference in the form "imagename:tag". If the tag has not been defined then latest is used.
      返回:
      the image reference in tagged form
      抛出:
      IllegalStateException - if the image reference contains a digest
    • inTaglessForm

      public ImageReference inTaglessForm()
      Return an ImageReference without the tag.
      返回:
      the image reference in tagless form
    • inTaggedOrDigestForm

      public ImageReference inTaggedOrDigestForm()
      Return an ImageReference containing either a tag or a digest. If neither the digest nor the tag has been defined then tag latest is used.
      返回:
      the image reference in tagged or digest form
    • forJarFile

      public static ImageReference forJarFile(File jarFile)
      Create a new ImageReference instance deduced from a source JAR file that follows common Java naming conventions.
      参数:
      jarFile - the source jar file
      返回:
      an ImageName for the jar file.
    • random

      public static ImageReference random(String prefix)
      Generate an image name with a random suffix.
      参数:
      prefix - the name prefix
      返回:
      a random image reference
    • random

      public static ImageReference random(String prefix, int randomLength)
      Generate an image name with a random suffix.
      参数:
      prefix - the name prefix
      randomLength - the number of chars in the random part of the name
      返回:
      a random image reference
    • of

      public static ImageReference of(String value)
      Create a new ImageReference from the given value. The following value forms can be used:
      • name (maps to docker.io/library/name)
      • domain/name
      • domain:port/name
      • domain:port/name:tag
      • domain:port/name@digest
      参数:
      value - the value to parse
      返回:
      an ImageName instance
    • of

      public static ImageReference of(ImageName name)
      Create a new ImageReference from the given ImageName.
      参数:
      name - the image name
      返回:
      a new image reference
    • of

      public static ImageReference of(ImageName name, String tag)
      Create a new ImageReference from the given ImageName and tag.
      参数:
      name - the image name
      tag - the referenced tag
      返回:
      a new image reference
    • of

      public static ImageReference of(ImageName name, String tag, String digest)
      Create a new ImageReference from the given ImageName, tag and digest.
      参数:
      name - the image name
      tag - the referenced tag
      digest - the referenced digest
      返回:
      a new image reference