github.com/hustcat/docker@v1.3.3-0.20160314103604-901c67a8eeab/man/docker-tag.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % Docker Community 3 % JUNE 2014 4 # NAME 5 docker-tag - Tag an image into a repository 6 7 # SYNOPSIS 8 **docker tag** 9 [**--help**] 10 IMAGE[:TAG] [REGISTRY_HOST/][USERNAME/]NAME[:TAG] 11 12 # DESCRIPTION 13 Assigns a new alias to an image in a registry. An alias refers to the 14 entire image name including the optional `TAG` after the ':'. 15 16 If you do not specify a `REGISTRY_HOST`, the command uses Docker's public 17 registry located at `registry-1.docker.io` by default. 18 19 # "OPTIONS" 20 **--help** 21 Print usage statement. 22 23 **REGISTRY_HOST** 24 The hostname of the registry if required. This may also include the port 25 separated by a ':' 26 27 **USERNAME** 28 The username or other qualifying identifier for the image. 29 30 **NAME** 31 The image name. 32 33 **TAG** 34 The tag you are assigning to the image. Though this is arbitrary it is 35 recommended to be used for a version to distinguish images with the same name. 36 Also, for consistency tags should only include a-z0-9-_. . 37 Note that here TAG is a part of the overall name or "tag". 38 39 # EXAMPLES 40 41 ## Giving an image a new alias 42 43 Here is an example of aliasing an image (e.g., 0e5574283393) as "httpd" and 44 tagging it into the "fedora" repository with "version1.0": 45 46 docker tag 0e5574283393 fedora/httpd:version1.0 47 48 ## Tagging an image for a private repository 49 50 To push an image to a private registry and not the central Docker 51 registry you must tag it with the registry hostname and port (if needed). 52 53 docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0 54 55 # HISTORY 56 April 2014, Originally compiled by William Henry (whenry at redhat dot com) 57 based on docker.com source material and internal work. 58 June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 59 July 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 60 April 2015, updated by Mary Anthony for v2 <mary@docker.com> 61 June 2015, updated by Sally O'Malley <somalley@redhat.com>