Transcript from the "Wrapping Up" Lesson
>> So that brings us to the conclusion of our course. You survived Builder, you survived podman, you survived Kubernetes, that's something that you can like right on your resume that like I survived Kubernetes, all right? You learned a lot of stuff about Docker, which is awesome, you learned what a Container is, you learned how to handcraft container which is, again, what more than a lot of people can do that use containers every day.
[00:00:24] You'll learn what Docker is, where it can be useful, how to set up Docker files for both development and production, how to set up networks in Docker, bind mounts, volume, Docker compose and then a great introduction to the Ecosystem at large which would be Podman and Builder and stuff like that.
[00:00:43] The things that I think that will immediately help you as an engineer, as a developer is how to make a share developer container, I think that's very useful. How to make that work with Visual Studio Code which a few of us could use or make that very useful for you right away, how to get up and going if someone gives you a container right?
[00:00:59] Like if someone from your office teams has accused the container now you know what to do with it, right? And then how to start smaller scale like multi container projects with Docker compose and then eventually Kubernetes. I think those are like the key, immediately useful takeaways, I think everything else is just kind of knowing the ecosystem around containers.
[00:01:18] And then I think containers are just gonna become more and more important, right? Some of these like techniques that I've shown you are becoming more common at companies like Microsoft and Google and I think that's going to permeate down into these smaller companies as well, right? So I think you're ahead of the curve if you've gotten this far in the course of where the ecosystem and where the environment of the industry is going.
[00:01:45] And there's other things really cool that we didn't talk about, things like Azure Container Instances, AWS Fargate, Google Cloud Run, Visual Studio Online is another one that's really cool. And these are all things that are centered around containers like something like a CI Azure Container instances or Fargate, or Cloud Run.
[00:02:02] What you do is you give the cloud providers like here's my container, and then the cloud provider just takes in the container and starts running it and then it'll scale it up and scale down for you, it's their serverless containers. And you don't have to manage them, you dont have to scale them or anything like that, everything just kind of works so definitely check those out, those are a lot of fun.
[00:02:20] So I'm gonna come in here to the notes, and we're just gonna go over some last ecosystem things that you can go and do more investigation if you're interested. So it's here in the conclusion section. So if you want more container runtimes alternatives to build a Podman and Docker, there's lxc and lxd.
[00:02:39] So lxc, this also comes out of the open container, LINUX foundation kind of project, Docker used to based on lxc so it's kind of a fundamental building block. And so it's also based around containers, lxd is the daemon that runs in the background, the idea with lxd versus Docker.
[00:03:01] Docker is very much build for, I'm wanna spin up and destroy containers and I don't really care how frequently I do that, right? Nothing is meant to live forever, everything is disposable, that's kind of the Docker way. With lxd this is meant for containers that are gonna be running for a very long time, right?
[00:03:18] So these ones you gonna spin off a container, then you gonna go in and you gonna customize it, right? Lxd is for snowflake containers that you wanna keep running for a very, very long time. Then there's rocket, rkt which is from CoreOS and CoreOS just got bought by Red Hat and Red Hat got bought by IBM so IBM eventually owns rocket.
[00:03:41] It's very much meant to pair with CoreOS and it has the core idea of pods. And this is the exact same idea of pods to Kubernetes where you have these atomic deployments of five containers that are all bundled together, that's built into rocket whereas Docker doesn't necessarily have a concept of pods, right?
[00:04:02] So if you have that idea, then rocket's a good fit for you, it's also built into CoreOS, so if you're interested in that, in CoreOS, then rockets a good fit for that. Okay, and so we talked about Kupernetes which is an orchestration system, that's what you would call Kupernetes, it's a container orchestration system.
[00:04:20] There are a few others that you might wanna be aware of as well, Docker Swarm so built into Docker. In fact, if you come in here to close this close this town. If you say docker swarm like that, there's a whole bunch of stuff in here about how to initiate swarms and swarms are comparable to Kubernetes, right?
[00:04:44] You can have multiple containers being managed, I like how they're managed with Docker Swarm. So I link to their to their documentation if you're interested in doing Kubernetes like things, but with swarm, it's simpler, it's simpler, it's less powerful than Kubernetes. So it's actually very tempted to teach that too because I think it's a better way to get started with it but the thing is people wanna know Kubernetes, right?
[00:05:07] That's what everyone's saying, everyone's very interested and it's like decided to go that path but if you're interested in, I would definitely suggest you pick on Dockers form. On other side of that is Apache Mesos and Mesos is super hard, like I can't even get it started and I'm not even joking and try to get it started and I couldn't.
[00:05:27] So, it's even more powerful perhaps than Kubernetes, I don't know if I can back it up but it's as powerful as Kubernetes at least, but it's just very difficult to use. They've actually built a layer on top of the called Mesosphere which allows it to be a little bit more simple to use on.
[00:05:43] And now there's another layer on top of Mesosphere and the name escapes me but it's layers upon layers of being very difficult to use, but it does the same thing where you can orchestrate complex applications with Mesos. Mesos came out of Twitter, right? So now, all of Twitter's infrastructure is built with Mesos, whereas like Google invented Kubernetes.
[00:06:06] So they have a system called Borg and they kind of export that architecture and that became Kubernetes. Internally inside of Google, they still use Borg, though, just in case you're wondering. So I guess Mesos was invented at Berkeley and then Twitter adopted it I think that's more accurate way of putting it.
[00:06:26] The newcomer on the scene is a Hashicorp Nomad, I mentioned many of you know, Hashicorp, they did Vagrant, they did Terraform, they did console. They do a lot of tools that DevOps engineers really quite like, myself included, I think Hashicorp is a great company doing great stuff. And so they have recently come out with Nomad and Nomad is much more limited than Kubernetes, Kubernetes does a lot of stuff for you, like load balancing and a whole bunch of other stuff, right?
[00:06:55] It does everything out of the box, it's meant to be the kitchen sink of orchestration tools, Nomad is just the orchestration part and it is nothing else. So, if you're into that, kind of, that Unix methodology of, like, this tool does one thing, and it does it super well, and it is literally nothing else, Normad is probably what you're looking for.
[00:07:15] So, it's meant to pair with things, like, Terraform, and Console, and Vault and all their various different tools together. Like, for example, we didn't talk about Kubernetes as a secret management, right? There's a secret management tool built into Kubernetes, it's not built into Nomad, they have a separate product called Hashicorp Vault, and that's meant to pair it together with Nomad.
[00:07:35] So, check that as well, people are liking it so that's all I really can say about that but I like and trust Hashicorp. Something that we didn't really talk a ton about is what is the host, what is running your servers in production, right? Now sometimes you're just giving your containers to Azure and say, hey, Azure, execute this for me, right?
[00:07:58] In which case you don't care about what's running it because the cloud provider is choosing it and not you. But if you're running your own VM's and your VM's are executing your containers, you'd have to choose what the host operating system is. So, there's one called CoreOS Container Linux.
[00:08:15] This is, or people just call it CoreOS, they don't separate out the Container Linux is different but it actually technically is called Container Linux and is made by CoreOS. So it's a minimal Linux OS host, it's one of the most popular ones for sure and it just shipped with a bunch of tools that make it very simple to get started with containers so that's a very popular one.
[00:08:35] I like RancherOS, I started playing with the other day and it's just a It's a very strange operating system in a fun way, that normally you have like bashes like the PID1, like the first thing that execute, with Ranchero is everything is executed by Docker, everything is a container.
[00:08:54] So if you execute anything within Rancher, it's Docker that's doing the execution of it so every single process is a container, which is really, really fun. So, definitely give it a shot. There's one called Ubuntu, I think we've all heard of this, right? Ubuntu is really great executing containers, I think they have a project that actually is meant, they have like a specific distribution of it.
[00:09:21] I can't remember it's called a Snappy, might be called Snappy something like that but you can also use Fedora, you can use DBN, any one of those Linux Operating Systems. There are not built for containers, but they are built for everything, but containers are part of everything so it's a valid choice to think about using those as well.
[00:09:39] And this one out here that I wanted to called DC/OS, this is strongly associated not with Kubernetes with Mesos. However, I am told that DC/OS can definitely run Kubernetes as well and it can be controlled, You can have Mesos and Kubernetes talk to each other, which just sounds like some sort of hell that I don't wanna be in.
[00:10:00] So anyway, DC/OS, which stands for Distributed Cloud Operating System, it's very unique. Yeah, people really like DC/OS more than they like Mesos, I've never used it so I'm not gonna tell you anything more about it than that, but people like it. And then VMWare Photon comes from the company VMWare which makes a bunch of tools that you probably are already using.
[00:10:23] They recently came up with their own container IOS operating system called Photon so it's meant to mostly pair into their other tools like vSphere and such. So I think we had some good questions from the audience, one of them I remember that are from the online crowd, one of the they asked was, what's the difference between CMD and Rin?
[00:10:43] So let's go take a look at that really quick. Here my Docker file, you can see here I have RUN, and I have CMD down here at the end. One of these is done at runtime and one of them is done at build time so RUN, this is going to get run as soon as I say Docker built, right?
[00:11:01] So you're gonna do all the dependencies installing when you're building the container and CMD is where you're telling Docker is like when someone runs this container, when someone does Docker run, Run this, right? So this is at runtime, this is a build time. You are also very likely gonna have multiple Docker Run or you gonna have RUN and you can see here I have three RUNs in here.
[00:11:28] Whereas you only ever have at most one CMD.
>> Can this be set up with Gatsby as well, and those having a VS Code extension help set this up pretty easy? This is the question.
>> Sure, like we did Hugo before, could you do this with Gatsby? And the answer is absolutely, right?
[00:11:47] So if you had like a Gatsby project and you're working with a bunch of people that didn't know how to use Node and NPM and all that kind of stuff, you could totally wrap this up in a container. It would work just as well, my guess is that there's probably, already a Gatsby container or Docker does the exact same thing.
[00:12:00] So yeah, for sure, you can definitely do that. Something I didn't really get into as much in here, cuz the person mentioned VS Code is the Docker extension for VS Code. You can see here that it shows me all of my containers or in fact, I can see here that my builder container is actually still running, and I can just say, you know what, I'm done with this, stop and it will just stop my container for me, just like that.
[00:12:25] And here I can come here and run, I can pull containers, here's all my images that I've pulled where I can see that I have various versions of alpine, I have various versions of node app, builder, codesmith that's one that I built awhile ago for our good friend, will sentence, actually.
[00:12:41] So, this is something worth checking out as well so you can see I'm also connected to an Azure registry, is that true? No, I would have to sign in but you can connect it to Azure, you can connect it to Google, or GitHub, or all these things as well, yeah.
>> Another question, what would be the best way to monitor an alert on containers going down at scale?
>> That is a good question, what's the best way to monitor? There's a lot of products that do this for you, you can go as far as using things like New Relic which work really well and they have specific things for containers.
[00:13:18] Each of the cloud provider has various different mechanisms for monitoring, like Azure we have App Insights, I think it's Cloud Watch for AWS. I don't remember what GCP's is called, but they all have their own specific incantations thereof That being said, there are probably other tools like you can use things like StatsD and NSCD.
[00:13:40] Not NSCD but rather StatsD for doing some sort of consolidated logging, there's a lot of different products out there. I'm not more familiar with any one of them than the other, there's also Sentry, Sentry would be a good one. So, honestly there's not much difference between what you would be concerned about versus what Kubernetes is doing, versus what a normal web service is doing.
[00:14:05] You're gonna treat them relatively the same way for the most part. There's some specific Kubernetes stuff, and your cloud provider will provide that for you. All right, well, congratulations. This is a deeply technical topic and hopefully was presented to you in such that like you learned something about it, I had a lot of fun creating this course for you.
[00:14:24] If you liked it again, a start and GitHub says a lot helps me, feel free to Tweeted me, file issues, open PRs. I already saw someone open a PR last night so I'm gonna go merge that so thank you for helping me make the best course possible. Thanks again to Frontend Masters and the whole crew.
[00:14:39] You all are the best. But in the end, I think containers are gonna be important tools for all of you, whether you write CSS, Haskell, or NodeJS. Like it's useful to everyone, and I think going forward, you are gonna be ahead of that curve because you took this course.
[00:14:56] So thank you.