|
@@ -7,44 +7,59 @@ docker-tag - Tag an image into a repository
|
|
|
# SYNOPSIS
|
|
|
**docker tag**
|
|
|
[**--help**]
|
|
|
-IMAGE[:TAG] [REGISTRY_HOST/][USERNAME/]NAME[:TAG]
|
|
|
+NAME[:TAG] NAME[:TAG]
|
|
|
|
|
|
# DESCRIPTION
|
|
|
Assigns a new alias to an image in a registry. An alias refers to the
|
|
|
entire image name including the optional `TAG` after the ':'.
|
|
|
|
|
|
-If you do not specify a `REGISTRY_HOST`, the command uses Docker's public
|
|
|
-registry located at `registry-1.docker.io` by default.
|
|
|
-
|
|
|
# "OPTIONS"
|
|
|
**--help**
|
|
|
Print usage statement.
|
|
|
|
|
|
-**REGISTRY_HOST**
|
|
|
- The hostname of the registry if required. This may also include the port
|
|
|
-separated by a ':'
|
|
|
-
|
|
|
-**USERNAME**
|
|
|
- The username or other qualifying identifier for the image.
|
|
|
-
|
|
|
**NAME**
|
|
|
- The image name.
|
|
|
+ The image name which is made up of slash-separated name components,
|
|
|
+ optionally prefixed by a registry hostname. The hostname must comply with
|
|
|
+ standard DNS rules, but may not contain underscores. If a hostname is
|
|
|
+ present, it may optionally be followed by a port number in the format
|
|
|
+ `:8080`. If not present, the command uses Docker's public registry located at
|
|
|
+ `registry-1.docker.io` by default. Name components may contain lowercase
|
|
|
+ characters, digits and separators. A separator is defined as a period, one or
|
|
|
+ two underscores, or one or more dashes. A name component may not start or end
|
|
|
+ with a separator.
|
|
|
|
|
|
**TAG**
|
|
|
- The tag you are assigning to the image. Though this is arbitrary it is
|
|
|
-recommended to be used for a version to distinguish images with the same name.
|
|
|
-Also, for consistency tags should only include a-z0-9-_. .
|
|
|
-Note that here TAG is a part of the overall name or "tag".
|
|
|
+ The tag assigned to the image to version and distinguish images with the same
|
|
|
+ name. The tag name may contain lowercase and uppercase characters, digits,
|
|
|
+ underscores, periods and dashes. A tag name may not start with a period or a
|
|
|
+ dash and may contain a maximum of 128 characters.
|
|
|
|
|
|
# EXAMPLES
|
|
|
|
|
|
-## Giving an image a new alias
|
|
|
+## Tagging an image referenced by ID
|
|
|
|
|
|
-Here is an example of aliasing an image (e.g., 0e5574283393) as "httpd" and
|
|
|
-tagging it into the "fedora" repository with "version1.0":
|
|
|
+To tag a local image with ID "0e5574283393" into the "fedora" repository with
|
|
|
+"version1.0":
|
|
|
|
|
|
docker tag 0e5574283393 fedora/httpd:version1.0
|
|
|
|
|
|
+## Tagging an image referenced by Name
|
|
|
+
|
|
|
+To tag a local image with name "httpd" into the "fedora" repository with
|
|
|
+"version1.0":
|
|
|
+
|
|
|
+ docker tag httpd fedora/httpd:version1.0
|
|
|
+
|
|
|
+Note that since the tag name is not specified, the alias is created for an
|
|
|
+existing local version `httpd:latest`.
|
|
|
+
|
|
|
+## Tagging an image referenced by Name and Tag
|
|
|
+
|
|
|
+To tag a local image with name "httpd" and tag "test" into the "fedora"
|
|
|
+repository with "version1.0.test":
|
|
|
+
|
|
|
+ docker tag httpd:test fedora/httpd:version1.0.test
|
|
|
+
|
|
|
## Tagging an image for a private repository
|
|
|
|
|
|
To push an image to a private registry and not the central Docker
|