1 00:00:05,260 --> 00:00:08,890 ‫This section is going to be all about container image registries. 2 00:00:09,220 --> 00:00:10,590 ‫There's a lot to go through, 3 00:00:10,600 --> 00:00:15,600 ‫so, we're actually going to start with basically saying that you need an image registry in your plan. 4 00:00:15,610 --> 00:00:20,890 ‫It's not really an optional part of the container ecosystem. The way that Docker and other tools are 5 00:00:20,890 --> 00:00:27,580 ‫designed is that they need a place, off your servers and off of your developer workstations, to actually 6 00:00:27,580 --> 00:00:28,870 ‫store your images. 7 00:00:28,870 --> 00:00:33,790 ‫Technically, they can be zip files and you can export and import them but that's really an arduous 8 00:00:34,180 --> 00:00:34,840 ‫situation. 9 00:00:34,840 --> 00:00:41,010 ‫So you really want to plan for a registry, whether it's on the internet or a private one. 10 00:00:41,110 --> 00:00:45,100 ‫We're going to actually go through some things and different lectures here where we talk about the 11 00:00:45,100 --> 00:00:48,830 ‫details of Docker Hub and some of the auto-build options there. 12 00:00:48,910 --> 00:00:53,800 ‫We're going to focus on the Docker Store for a lecture and how that's actually different than Hub. 13 00:00:54,040 --> 00:01:00,280 ‫And then the Docker Cloud option, which is actually also different than Hub, but also an add-on to the 14 00:01:00,280 --> 00:01:01,190 ‫Docker tool set, 15 00:01:01,210 --> 00:01:07,390 ‫and maybe could help you make it easier to deploy servers and your stuff into the cloud. 16 00:01:07,390 --> 00:01:12,610 ‫We also have the new Swarms feature now in Docker Cloud that I’ll have a specific lecture on. 17 00:01:12,610 --> 00:01:18,610 ‫And then, you're going to learn how to build your own registry and deploy it on either your local machine 18 00:01:18,610 --> 00:01:21,760 ‫or on a Docker Swarm to use as a private registry. 19 00:01:21,760 --> 00:01:26,680 ‫It's actually open-source. And then we'll mention some of the third-party registry options in case you 20 00:01:26,680 --> 00:01:31,790 ‫don't want to use Docker Hub or the open-source Docker registry. 21 00:01:31,810 --> 00:01:36,280 ‫In this lecture we're going to cover some of the advanced topics of Docker Hub. 22 00:01:36,280 --> 00:01:41,280 ‫Now, it is the most popular image registry in the world for containers, but it's not the only one. 23 00:01:41,350 --> 00:01:44,050 ‫Let's just see what it does 24 00:01:44,050 --> 00:01:51,700 ‫in addition to what we've already discussed so far. In summary, Hub is a registry, but it also has image building 25 00:01:51,700 --> 00:01:51,900 ‫in it. 26 00:01:51,910 --> 00:01:54,630 ‫That's not normally a part of, 27 00:01:54,700 --> 00:01:59,560 ‫for example, the open-source registry and so it does have a little bit of extra stuff in it that allows 28 00:01:59,560 --> 00:02:01,330 ‫you to build images on the fly. 29 00:02:01,600 --> 00:02:04,460 ‫We're going to jump into some of those features here. 30 00:02:04,660 --> 00:02:09,910 ‫And then, also talk about linking your GitHub and BitBucket accounts to Hub and checking out some of 31 00:02:09,910 --> 00:02:14,130 ‫the auto-build features for building your images based on the commits. 32 00:02:14,200 --> 00:02:19,300 ‫And then, we're going to show some features around chaining image building together, so that you can make 33 00:02:19,300 --> 00:02:22,100 ‫it easier to make sure your images are always up to date. 34 00:02:23,610 --> 00:02:26,400 ‫We've already covered a little bit about Docker Hub 35 00:02:26,460 --> 00:02:32,910 ‫when we first learned about images earlier in this course. But, I wanted to go through some of the other 36 00:02:32,910 --> 00:02:38,760 ‫features that maybe we haven't discussed, and then compare that to the Docker Store, and then talk about 37 00:02:38,760 --> 00:02:45,440 ‫what Docker Cloud might do for us before we actually get into other registry options for ourselves. 38 00:02:45,480 --> 00:02:47,820 ‫Obviously, Docker Hub is a registry. 39 00:02:47,820 --> 00:02:50,100 ‫It's what we've been talking about this whole course. 40 00:02:50,100 --> 00:02:55,530 ‫It's how we pull all of our images, and it is the default registry for Docker. But, it's not the only one 41 00:02:55,530 --> 00:02:56,500 ‫by far. 42 00:02:56,940 --> 00:03:00,180 ‫Let's talk about what it can do besides what we've already done. 43 00:03:00,180 --> 00:03:05,640 ‫We can see that I have repositories here, obviously. You can tell that I actually have at least one private 44 00:03:05,640 --> 00:03:07,680 ‫one here. The private ones, 45 00:03:07,680 --> 00:03:11,000 ‫you get one free, and the rest you have to pay for. 46 00:03:11,010 --> 00:03:17,760 ‫You set up a billing account like normal and you pay for that. When you create repositories, and on 47 00:03:17,760 --> 00:03:22,630 ‫each one of your images, whether they're public or private, you can choose to give permissions to people. 48 00:03:22,630 --> 00:03:27,230 ‫This is what my view would look like for a repository that I own. 49 00:03:27,240 --> 00:03:28,710 ‫This happens to be a public one. 50 00:03:28,740 --> 00:03:33,930 ‫If I went into Settings, you can see that I can switch back and forth between making it private and 51 00:03:33,930 --> 00:03:34,630 ‫public. 52 00:03:34,710 --> 00:03:40,740 ‫I can delete it. I can create webhooks, and the webhooks are really handy for when your images are built 53 00:03:40,830 --> 00:03:43,050 ‫and pushed into Docker Hub. 54 00:03:43,050 --> 00:03:48,270 ‫You can have it send a webhook to some other service, like Jenkins or Codeship, or Travis CI, or something 55 00:03:48,270 --> 00:03:52,060 ‫like that, to have automated builds continue down the lines. 56 00:03:52,080 --> 00:03:56,910 ‫Those webhooks are there to help you automate the process of getting your code all the way from 57 00:03:56,910 --> 00:04:02,580 ‫something like Git or GitHub to Docker and all the way to your servers where you want to run them. The 58 00:04:02,630 --> 00:04:06,990 ‫Collaborators is the permissions area where you can set permissions for other people to do things with 59 00:04:06,990 --> 00:04:07,900 ‫your image. 60 00:04:08,040 --> 00:04:14,130 ‫And then we also have Organizations. So, you have your own permissions for your own repositories and then 61 00:04:14,130 --> 00:04:18,240 ‫you can give others permissions to your repositories. But, if you want to create organizations you can 62 00:04:18,240 --> 00:04:18,900 ‫do that as well. 63 00:04:18,900 --> 00:04:19,950 ‫They're totally free. 64 00:04:19,950 --> 00:04:25,590 ‫For example, underneath this organization, I can see all of their repos. And then, because I have the 65 00:04:25,590 --> 00:04:29,860 ‫permissions for each one, I can actually go in and change all their settings. 66 00:04:29,880 --> 00:04:31,830 ‫You can see that I can control team membership. 67 00:04:31,830 --> 00:04:36,760 ‫I can control billing like you would normally do for private images. 68 00:04:36,780 --> 00:04:41,300 ‫This is very much like GitHub, if you've used GitHub at all, or if you've ever paid for anything on GitHub. 69 00:04:41,310 --> 00:04:46,480 ‫It's very similar where everything that's open-source is free and then anything you want to be private 70 00:04:46,530 --> 00:04:52,330 ‫you have to pay for in-group plans. And the Organizations work the same way as GitHub. 71 00:04:52,590 --> 00:04:54,500 ‫There's not a whole lot else to it. 72 00:04:54,510 --> 00:04:58,350 ‫I just want to show you a few key things that you need to know if you want to start using it. 73 00:04:58,350 --> 00:05:05,430 ‫One is, if you're using a GitHub or BitBucket to store your code, don't click this button to create your 74 00:05:05,430 --> 00:05:06,720 ‫repository. 75 00:05:06,720 --> 00:05:13,020 ‫Also, don't do a Docker push before creating it first, because what you really want to do is go up here 76 00:05:13,020 --> 00:05:20,370 ‫to create and create automated build. The automated build allows Docker Hub to create this CI path 77 00:05:20,400 --> 00:05:24,840 ‫that will automatically build your image based on code commits. 78 00:05:25,020 --> 00:05:27,110 ‫This is like the reverse webhook. 79 00:05:27,180 --> 00:05:32,340 ‫The webhooks we just looked at a while ago are for Docker Hub to notify something else that it's finished 80 00:05:32,340 --> 00:05:33,140 ‫with an image. 81 00:05:33,180 --> 00:05:38,230 ‫But this process allows Docker Hub to be notified when something else happens. 82 00:05:38,370 --> 00:05:42,130 ‫I always set it up for auto-building my own repositories. 83 00:05:42,180 --> 00:05:48,520 ‫In this case, for instance, I just chose a repository I have access to and GitHub. 84 00:05:48,570 --> 00:05:53,090 ‫And then, I give it a short description and it allows me to create a repository. 85 00:05:53,160 --> 00:05:55,670 ‫But, in this case, it knows it's coming from GitHub. 86 00:05:55,680 --> 00:06:00,930 ‫Anytime there's a commit based on certain requirements, or certain branches, it will actually build 87 00:06:00,930 --> 00:06:02,300 ‫my image on the fly. 88 00:06:02,400 --> 00:06:05,000 ‫Then I get a nice little e-mail saying it's successful or not. 89 00:06:05,310 --> 00:06:09,020 ‫That's why you see on a lot of images that they're automated builds. 90 00:06:09,150 --> 00:06:14,220 ‫That's just one indication of quality because it shows that this image is likely always up to date 91 00:06:14,220 --> 00:06:19,560 ‫with wherever the source code is. You'll see here, like the Jekyll server that we used previously 92 00:06:19,560 --> 00:06:26,280 ‫in this course, that I have some of these automated options here that I didn't have in the previous repository 93 00:06:26,280 --> 00:06:28,620 ‫that wasn't set up for automation. 94 00:06:28,650 --> 00:06:34,620 ‫So here I have build details, build settings. You can see that each time it's built it's successful 95 00:06:34,710 --> 00:06:40,260 ‫in the history. And then, in the build settings, I can choose which branches I want to build. Something 96 00:06:40,290 --> 00:06:44,080 ‫I highly recommend is that, down here under repository links, 97 00:06:44,160 --> 00:06:49,950 ‫if you are building images on Docker Hub, and you're using a from statement that you're pulling from 98 00:06:49,950 --> 00:06:56,880 ‫some other image, then you want to set up repository links here, so that any time that software changes 99 00:06:57,210 --> 00:06:58,760 ‫your image gets rebuilt. 100 00:06:58,860 --> 00:07:05,580 ‫And that's a big deal because, over time your, image is going to have dependencies on it, and it's going 101 00:07:05,580 --> 00:07:08,230 ‫to need to update when those get updated themselves, 102 00:07:08,280 --> 00:07:14,250 ‫maybe based on security requirements or new bug fixes. And so, on mine, because it's running Ruby and Jekyll 103 00:07:14,250 --> 00:07:19,090 ‫inside my image, and it's from statement in the Docker file is actually the Jekyll, 104 00:07:19,200 --> 00:07:25,030 ‫I put those here so that any time those images get rebuilt, mine will then get rebuilt. 105 00:07:25,290 --> 00:07:31,950 ‫If you also want to create a build trigger...a build trigger is another inbound way for you to automatically 106 00:07:31,950 --> 00:07:37,410 ‫have an image be built, and maybe you have some other software that's not GitHub that you want to kick 107 00:07:37,410 --> 00:07:39,450 ‫off builds whenever something happens. 108 00:07:39,450 --> 00:07:42,040 ‫So you can create those unique post URLs there.