@@ -37,22 +37,33 @@ In the following image, you can see an example Docker command from Docker Hub. T
3737
3838
3939## Push the image
40+ Let's try to push the image to Docker Hub.
4041
41- 1 . Sign in to Docker Hub using the command: ` docker login ` .
42- 2 . In the command line, run the ` docker push ` command that you see on Docker
43- Hub. Note that your command will have your Docker ID, not "docker". For example, ` docker push YOUR-USER-NAME/getting-started ` .
42+ 1 . In the command line, run the following commmand:
43+
44+ ``` console
45+ docker push docker/getting-started
46+ ```
47+
48+ You'll see an error like this:
4449
4550 ``` console
4651 $ docker push docker/getting-started
4752 The push refers to repository [docker.io/docker/getting-started]
4853 An image does not exist locally with the tag: docker/getting-started
4954 ```
5055
51- Why did it fail? The push command was looking for an image named ` docker/getting-started ` , but
52- didn't find one. If you run ` docker image ls ` , you won't see one either.
56+ This failure is expected because the image isn't tagged correctly yet.
57+ Docker is looking for an image name ` docker/getting started ` , but your
58+ local image is still named ` getting-started ` .
5359
54- To fix this, you need to tag your existing image you've built to give it another name.
60+ You can confirm this by running:
61+
62+ ``` console
63+ docker image ls
64+ ```
5565
66+ 2 . To fix this, first sign in to Docker Hub using your Docker ID: ` docker login YOUR-USER-NAME ` .
56673 . Use the ` docker tag ` command to give the ` getting-started ` image a new name. Replace ` YOUR-USER-NAME ` with your Docker ID.
5768
5869 ``` console
0 commit comments