github.com/yogeshlonkar/moby@v1.13.2-0.20201203103638-c0b64beaea94/man/docker-tag.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % Docker Community 3 % JUNE 2014 4 # NAME 5 docker-tag - Create a tag `TARGET_IMAGE` that refers to `SOURCE_IMAGE` 6 7 # SYNOPSIS 8 **docker tag** 9 [**--help**] 10 SOURCE_NAME[:TAG] TARGET_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 # "OPTIONS" 17 **--help** 18 Print usage statement. 19 20 **NAME** 21 The image name which is made up of slash-separated name components, 22 optionally prefixed by a registry hostname. The hostname must comply with 23 standard DNS rules, but may not contain underscores. If a hostname is 24 present, it may optionally be followed by a port number in the format 25 `:8080`. If not present, the command uses Docker's public registry located at 26 `registry-1.docker.io` by default. Name components may contain lowercase 27 letters, digits and separators. A separator is defined as a period, one or 28 two underscores, or one or more dashes. A name component may not start or end 29 with a separator. 30 31 **TAG** 32 The tag assigned to the image to version and distinguish images with the same 33 name. The tag name must be valid ASCII and may contain lowercase and 34 uppercase letters, digits, underscores, periods and hyphens. A tag name 35 may not start with a period or a hyphen and may contain a maximum of 128 36 characters. 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 70 71 # HISTORY 72 April 2014, Originally compiled by William Henry (whenry at redhat dot com) 73 based on docker.com source material and internal work. 74 June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 75 July 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 76 April 2015, updated by Mary Anthony for v2 <mary@docker.com> 77 June 2015, updated by Sally O'Malley <somalley@redhat.com>