- [Instructor] There's really only
a few commands that you use to interact
with a registry from a Docker host.
So we covered docker login to log in to the registry.
We also covered docker logout to log out from the registry.
And now let's talk about docker push and docker pull.
The final command that we'll be covering
in another video is going to be docker search.
So in our case, let's go ahead
and use docker login to log in to Docker Hub.
We'll put in our Docker Hub username and password.
We can see that login succeeded.
So if we have a docker image that we're looking at,
for example, let's say that we're going
to use the NGINX latest image right here,
and let's say that we want to push that up to Docker Hub.
So to push up that image,
it first needs to be tagged in the proper format.
So we need to use a docker tag,
and we're going to tag nginx:latest,
and we're just going to call it daviddavistx,
which is the name of my registry up on Docker Hub,
and then we'll just add nginx:latest.
So now that image is tagged.
If we do a docker images or docker image ls,
you can see we have daviddavisnginx:latest.
So, now let's clear the screen and let's do a docker push,
and we'll push up daviddavistx,
which is the name of our registry,
/nginx, which is the name of the image,
and then the tag which is latest.
So let's push that up and notice that it says the push
refers to a repository and we're pushing it up here
to docker io which is Docker Hub
and the name of our registry
and then the specific repository which is going to be nginx.
And it looks like it concluded there.
Now if we go over to Docker hub,
and of course I've already logged in
and if we scroll down,
here is actually a brand new repository
that was created based on our docker push.
If we click on that repository
and go into tags you can see
here's the tag that was applied, latest
for the ngnix image in our public repository.
So that's how easy it is to push up an image
up to Docker Hub or up to a registry.
So now if we do a docker images
you can see that nginx image is there.
Let's do a docker image remove
and we'll remove that image daviddavistx/nginx:latest
and that image was untagged.
Now let's do an up arrow here
because all we need to do is go back
and change this push to a pull
and we're doing a docker pull.
So we'll pull back down that image that we just removed.
And there we go, pulling that image.
I'll do a docker images and there you go.
You can see that image has returned.
So that's how easy it is to push images
and pull images from a registry.
One last thing I want to mention here
is the concept of signing images.
When hundreds or thousands of images
are being distributed between thousands of individuals
and companies out on the internet,
and even at large enterprises between
many different developers and third parties
it's important to know that the person who says
they created that docker image
is really who they say they are.
And that's where the need for
Docker Content Trust came about.
With Docker Content Trust you're able
to digitally sign images with your private key
and then when those images are downloaded
you can verify that image came from
the person who says they really created it
by verifying their public key.
For example, you can see how someone
logged in with docker login.
They applied a tag to an image.
They pushed up the image
and then in these last two lines
the image was digitally signed.
And it will be verified when
it's downloaded from the registry.
So Docker Content Trust is available
in Docker Enterprise Edition.
It is one of the important features
offered by Enterprise Edition
to provide greater security.
However if you don't want to pay for
the features of Enterprise Edition
Docker also offers what they call Docker Notary.
Which is an open source version
essentially of Content Trust.
It allows you to create your own Content Trust.
So it's similar in concept to
the Docker open source registry
but Docker Open Source Notary
allows you to perform your own image signing
and essentially create your own
more basic Content Trust.
Keep in mind that image signing
is different from image scanning.
Image signing is verifying the publisher
is who they say they are.
Image scanning is verifying the software
that's inside the images to ensure
that those images don't contain vulnerabilities.
So Docker Enterprise Edition
provides Content Trust.
Docker Notary provides
an open source version of Content Trust
and Dockers Enterprise Edition Trusted Registry
provides image scanning.