@@ -38,22 +38,33 @@ In the following image, you can see an example Docker command from Docker Hub. T
3838
3939## Push the image
4040
41- 1 . In the command line, run the ` docker push ` command that you see on Docker
42- Hub. Note that your command will have your Docker ID, not "docker". For example, ` docker push YOUR-USER-NAME/getting-started ` .
41+ Let's try to push the image to Docker Hub.
42+
43+ 1 . In the command line, run the following commmand:
44+
45+ ``` console
46+ docker push docker/getting-started
47+ ```
48+
49+ You'll see an error like this:
4350
4451 ``` console
4552 $ docker push docker/getting-started
4653 The push refers to repository [docker.io/docker/getting-started]
4754 An image does not exist locally with the tag: docker/getting-started
4855 ```
4956
50- Why did it fail? The push command was looking for an image named ` docker/getting-started ` , but
51- didn't find one. If you run ` docker image ls ` , you won't see one either.
57+ This failure is expected because the image isn't tagged correctly yet.
58+ Docker is looking for an image name ` docker/getting started ` , but your
59+ local image is still named ` getting-started ` .
5260
53- To fix this, you need to tag your existing image you've built to give it another name.
61+ You can confirm this by running:
5462
55- 2 . Sign in to Docker Hub using the command ` docker login -u YOUR-USER-NAME ` .
63+ ``` console
64+ docker image ls
65+ ```
5666
67+ 2 . To fix this, first sign in to Docker Hub using your Docker ID: ` docker login YOUR-USER-NAME ` .
57683 . Use the ` docker tag ` command to give the ` getting-started ` image a new name. Replace ` YOUR-USER-NAME ` with your Docker ID.
5869
5970 ``` console
0 commit comments