github.com/kobeld/docker@v1.12.0-rc1/docs/reference/commandline/tag.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "tag"
     4  description = "The tag command description and usage"
     5  keywords = ["tag, name, image"]
     6  [menu.main]
     7  parent = "smn_cli"
     8  +++
     9  <![end-metadata]-->
    10  
    11  # tag
    12  
    13      Usage: docker tag [OPTIONS] NAME[:TAG] NAME[:TAG]
    14  
    15      Tag an image into a repository
    16  
    17        --help               Print usage
    18  
    19  An image name is made up of slash-separated name components, optionally prefixed
    20  by a registry hostname. The hostname must comply with standard DNS rules, but
    21  may not contain underscores. If a hostname is present, it may optionally be
    22  followed by a port number in the format `:8080`. If not present, the command
    23  uses Docker's public registry located at `registry-1.docker.io` by default. Name
    24  components may contain lowercase characters, digits and separators. A separator
    25  is defined as a period, one or two underscores, or one or more dashes. A name
    26  component may not start or end with a separator.
    27  
    28  A tag name may contain lowercase and uppercase characters, digits, underscores,
    29  periods and dashes. A tag name may not start with a period or a dash and may
    30  contain a maximum of 128 characters.
    31  
    32  You can group your images together using names and tags, and then upload them
    33  to [*Share Images via Repositories*](../../tutorials/dockerrepos.md#contributing-to-docker-hub).
    34  
    35  # Examples
    36  
    37  ## Tagging an image referenced by ID
    38  
    39  To tag a local image with ID "0e5574283393" into the "fedora" repository with
    40  "version1.0":
    41  
    42      docker tag 0e5574283393 fedora/httpd:version1.0
    43  
    44  ## Tagging an image referenced by Name
    45  
    46  To tag a local image with name "httpd" into the "fedora" repository with
    47  "version1.0":
    48  
    49      docker tag httpd fedora/httpd:version1.0
    50  
    51  Note that since the tag name is not specified, the alias is created for an
    52  existing local version `httpd:latest`.
    53  
    54  ## Tagging an image referenced by Name and Tag
    55  
    56  To tag a local image with name "httpd" and tag "test" into the "fedora"
    57  repository with "version1.0.test":
    58  
    59      docker tag httpd:test fedora/httpd:version1.0.test
    60  
    61  ## Tagging an image for a private repository
    62  
    63  To push an image to a private registry and not the central Docker
    64  registry you must tag it with the registry hostname and port (if needed).
    65  
    66      docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0