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