1DOCKER(1) JUNE 2014 DOCKER(1)
2
3
4
6 docker-tag - Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
7
8
9
11 docker tag [--help] SOURCE_NAME[:TAG] TARGET_NAME[:TAG]
12
13
14
16 Assigns a new alias to an image in a registry. An alias refers to the
17 entire image name including the optional TAG after the ':'.
18
19
20
22 --help
23 Print usage statement.
24
25
26 NAME
27 The image name which is made up of slash-separated name components,
28 optionally prefixed by a registry hostname. The hostname must comply
29 with
30 standard DNS rules, but may not contain underscores. If a hostname
31 is
32 present, it may optionally be followed by a port number in the
33 format
34 :8080. If not present, the command uses Docker's public registry
35 located at
36 registry-1.docker.io by default. Name components may contain
37 lowercase
38 characters, digits and separators. A separator is defined as a
39 period, one or
40 two underscores, or one or more dashes. A name component may not
41 start or end
42 with a separator.
43
44
45 TAG
46 The tag assigned to the image to version and distinguish images with
47 the same
48 name. The tag name may contain lowercase and uppercase characters,
49 digits,
50 underscores, periods and dashes. A tag name may not start with a
51 period or a
52 dash and may contain a maximum of 128 characters.
53
54
55
58 To tag a local image with ID "0e5574283393" into the "fedora"
59 repository with "version1.0":
60
61
62 docker tag 0e5574283393 fedora/httpd:version1.0
63
64
65
67 To tag a local image with name "httpd" into the "fedora" repository
68 with "version1.0":
69
70
71 docker tag httpd fedora/httpd:version1.0
72
73
74
75 Note that since the tag name is not specified, the alias is created for
76 an existing local version httpd:latest.
77
78
80 To tag a local image with name "httpd" and tag "test" into the "fedora"
81 repository with "version1.0.test":
82
83
84 docker tag httpd:test fedora/httpd:version1.0.test
85
86
87
89 To push an image to a private registry and not the central Docker
90 registry you must tag it with the registry hostname and port (if
91 needed).
92
93
94 docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0
95
96
97
98
100 April 2014, Originally compiled by William Henry (whenry at redhat dot
101 com) based on docker.com source material and internal work. June 2014,
102 updated by Sven Dowideit ⟨SvenDowideit@home.org.au⟩ July 2014, updated
103 by Sven Dowideit ⟨SvenDowideit@home.org.au⟩ April 2015, updated by Mary
104 Anthony for v2 ⟨mary@docker.com⟩ June 2015, updated by Sally O'Malley
105 ⟨somalley@redhat.com⟩
106
107
108
109Docker Community Docker User Manuals DOCKER(1)