Modern Python Projects Transcripts
Chapter: Deployment
Lecture: Publishing on Docker Hub

Login or purchase this course to watch this video and the rest of the course contents.
0:00 The easiest way to use the docker image that you have created is to publish it
0:05 on Docker Hub. docker hub is displays where you can find different docker images. So, for example, if we search for Python,
0:13 we can see the official Python image. And here, if we search for tags, here is the image that we used to build our own uptime and website image.
0:26 So to publish an image on docker Hub, make sure that you have a docker account, because first, we'll have to log in.
0:33 So first step is to run docker log in command and it will ask you for your user name and password. So I'm gonna type that behind the scenes.
0:44 Now make sure that you actually have a build image. As you can see, last time I cancelled. so I will have to build it again.
0:53 And now we have to tag our image. So, first you specify the local image. As you can see, when we were building,
1:05 we use the uptimer website name for the image and then you specify your user
1:10 name on docker hbb slash(/) the name of the repository and tag that you want to use, latest is one of the most common ones,
1:19 and this will suggest users that this is the latest version of your image. But you can also use stuff like version 1, version 2 or whatever you want.
1:29 And once you have tagged your image, we just have to run Docker, push and specify the stag. Well, I forgot to copy the latest tag,
1:43 but, as you can see by default will be using latest. So while this is running, let's talk about the images on docker Hub.
1:51 Basically, everything that you published on docker Have is a public image.
1:56 So if you're in a situation where you want to publish private image because you don't want to share the code with anyone,
2:03 there are some alternatives. Like for example, GitLab has the container repository. So,if you create a private project on git lab,
2:11 you can also build a docker image and store it on GitLab, so that that's one solution that you can use for private docker images.
2:18 Another idea would be to just start paying for a paid docker account, and with that, you can have unlimited private repositories.
2:25 I think even on the free account you have one free private repository where you can push some images without sharing them with the rest of the world.
2:33 Okay, so this is done. Let's actually see how it looks like in my profile, if I go here. Yeah. Yep. Here. I have it.
2:50 uptimer Website updated a minute ago. So once you have your image published on Docker Hub, you can just use this command to,
2:57 pull this image on any other computer, so let's try to deploy our image somewhere.


Talk Python's Mastodon Michael Kennedy's Mastodon