DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

Figure 13-31 Docker Hub Repository Setup


Once your repository is set up, you need to tag your
image to be pushed to Docker Hub. Use docker image
ls to list your images and take note of the image ID:


Click here to view code image


$ docker image ls
REPOSITORY TAG IMAGE ID CREATED
SIZE
myimage latest 04ae8c714993 About an
hour ago 154MB

Next, you need to issue the docker image tag
command with the image ID of your image and assign it
to username/newrepo:firsttry. newrepo simply identifies
the repo you want to place the image in, and the tag after
the : allows you to differentiate this particular image
from any other in the repository (in this instance, it is
named firsttry):


Click here to view code image


$ docker image tag 04ae8c714993
chrijack/newrepo:firsttry

Now you are ready to issue the push command, as
shown in Example 13-9, and you see Docker start to push
the layers of your container image to the repository.


Example 13-9 docker image push Command

Click here to view code image


$ docker image push chrijack/newrepo:firsttry
The push refers to repository
[docker.io/chrijack/newrepo]
3e92d80e0ac4: Pushed
a87bf84680fc: Pushed
02d0765ebf97: Pushed
e0b3afb09dc3: Pushed
6c01b5a53aac: Pushed
2c6ac8e5063e: Pushed
Free download pdf