‫OK. I'm super excited about this assignment for you because bind mounts can be really cool.
‫They're particularly cool for local development or local testing. Because as we've explained before,
‫they're going to allow you to edit files on your host operating system, and then they're actually running
‫or being used inside the container to do things in a much easier way.
‫In this example, we're actually going to be using something called a "Static Site Generator" and this
‫isn't specifically
‫a web developer assignment.
‫We're not actually going to be doing much other than editing a line of text.
‫Really, what this is about, is getting used to the idea of taking host data, that you have on your host
‫machine, and then mounting that into a container, then changing it on the host and watching it be
‫reflected inside the container.
‫Right.
‫In this case, this is a pretty common example. A web developer has source code and HTML and all
‫that, on their host and they normally would have to download all the special tools they need on the host,
‫Right?
‫We would need the programming language tools, a web server, some sort of file watcher that detects
‫changes and restarts things, and all these tools, right?
‫That's normally a big thing for web developers is to figure out how to make all that work on their
‫particular operating system and all the right versions.
‫But the cool thing is in Docker Hub, so many of these problems have gone away because the stacks of those
‫components are all inside a single container, and somebody has done all the hard work for you.
‫In this case, we're going to actually be using Jekyll,
‫and like I mentioned earlier, it's an SSG.
‫Those are really very basic tools that allow you to create markdown, which is basically plain text.
‫Then it takes those and generates it into an HTML website.
‫It's really great for small blogs or simple websites where you don't want to have to be an HTML guru,
‫and you just want to write something simple and have it posted on the web.
‫This is also whenever you see sites run by GitHub, known as GitHub Pages, Jekyll is also the tool that
‫they use.
‫In this case, you're going to jump into the bind mount sample directory, as listed here on the slide.
‫You're going to see some files there. You're going to edit those with your editor of choice, whether
‫it's Visual Studio Code, or Atom, or Vim, or Sublime Text or whatever you like.
‫We're going to have a container running in the background that's running Jekyll and watching those
‫files on your host, and detecting updates, and then automatically updating the web server that's built
‫into the container.
‫To get you started, here is the command you can actually use.
‫You want to jump into that bind mount sample directory, and then run this particular docker run command,
‫which will open up your default localhost and actually map that directory.
‫Remember, the pwd will map that into the site directory inside the container, which is what we've set
‫up here.
‫Then I've made you a custom, Jekyll container that's really easy to use and it's using all the latest
‫versions.
‫So what you should see is you should be able to run that, open up your browser localhost, see the
‫website there with the basic web page. That's actually using the default template. Then you're going
‫to just quickly jump into the post directory that's inside that bind mount sample.
‫You can actually see it here.
‫On my screen,
‫I actually have it in my Visual Studio code. So these will be the files inside that directory.
‫You'll just go into this file here, which is a markdown file, and it's OK if you're not a markdown
‫guru. You just need to change something in here, and then jump over to your web browser and notice
‫how it's reflected automatically as an update once you save the file.
‫Of course, I highly recommend looking at the logs inside Docker to see what it's doing, because it
‫will actually tell you every time a file is changed and it's reloaded the server.
‫If you get stuck or for this doesn't make sense you, just watch my answers lecture video right after
‫this.
‫I'm going to run through this and you can follow along if you get stuck.
‫Good luck.