So the next step is to push those two images that were built locally to private repository, and I think
Docker Hub is the easiest to set up if you don't have a repository because you just need to sign up
and you get one private repository for free, which is all we need.
So I already have an account, so I'm just going to sign in.
My count is basically blank, I don't have anything yet, so I'm going to go to repositories and create
one, I'm going to create a private one because usually when you're creating your own applications,
you would host them on a private repository, which is a realistic scenario.
That's why I'm using it in this tutorial.
So let's give it a name of Daymo.
If this is a repository where we will host both images.
So we're just going to give them a common name.
It's going to be Daymo.
If you can also create a repository per application and they have different takes.
But we're going to do both in one repository that's created and we're ready to push our image.
Now, here is a comment to push your images to a repository.
But important to note that before it you can do that, you have to authenticate to Docker Hub and your
private repository, obviously.
So how do you do that?
Is using Docker login form your command line and you use the same credentials that you used when logging
in Web application.
So I'm going to go ahead and do docker login.
My username.
It has remembered it is this one right here and the password, same as I have here.
So this is my password and I am logged in.
So this Docker login basically creates a local config file that stores the credentials.
Right.
So now you can pull and push images from your private repository.
So we did Docker log in.
The second thing we need to do is we need to take our local images accordingly.
Right.
So the take is basically the name of the repository and the tag name.
Let's go see what is the current take of our images.
Docker images.
Right.
This is the current name and take over images and we have to rename them or retake them, so to say
we can do that with Dr. Teg and I'm just going to copy those, actually.
So this is the repository name.
My doctor Idy and the repository name and the tech will actually be Java EP A. Responsively, we can
also do Java and then a version like 1.0 doesn't matter.
Doctor Tech actually takes two arguments.
The first one is the original image, which is Java EP latest, this one right here.
And this is going to be the new name sort of saying, so let's do that.
And if I do the images again, I see the copy of Java got created and it has a new name now.
Now, the reason for that is or why we have to take those images is that otherwise Docker doesn't know
where to push those images when you execute Docker push.
Right.
So if I had Java EP latest, it wouldn't know to which repository it should actually push that because
you may do docker login for multiple repositories at the same time.
So that's the way of packaging that destination.
Information inside the image name.
EP and the take, and they should upload.
Our Java image into the story, and this may take a couple of seconds, so it's done pushing.
And here you see we have one tech, which is Java 1.0.
Now, I have to mention here, normally you would have a repository for your application.
So for one application like Java, this would be a repository Java Web, and then you would have maybe
different versions like 1.0, 2.0 or two point one, et cetera, as text.
But here we just put it in both of them in one repository because one we have just one repository available.
And second, it doesn't really make much difference for our setup.
So Java Web image is already in repository.
Let's do the same for no JS image.
Let's again do that tagging.
So node EBR latest will be tagged to
node.
Again, one point zero.
And then we're going to just push that into the repository.
So let's see that the images here.
So now we have both images in our private report story.