Docker for Web Developers

Docker can bring many benefits to your development workflow and deployment process. You'll learn how to use Docker tools and commands, how to work with images and containers, container orchestration techniques, and much more.
Course info
Rating
(437)
Level
Beginner
Updated
Jul 20, 2018
Duration
5h 41m
Table of contents
Course Overview
Why Use Docker as a Developer?
Setting up Your Docker Environment
Using Docker Tools
Hooking Your Source Code into a Container
Building Custom Images with Dockerfile
Communicating Between Docker Containers
Managing Containers with Docker Compose
Running Your Containers in the Cloud
Reviewing the Case for Docker
Description
Course info
Rating
(437)
Level
Beginner
Updated
Jul 20, 2018
Duration
5h 41m
Description

Building web apps that run the same in multiple environments can be a time-consuming process. This course, Docker for Web Developers, will teach you how to use Docker's open platform so that you can efficiently build apps that run consistently across any machine. First, you'll learn about Docker, its toolbox, the Docker Machine and Docker Client commands, and how all these components help you in your development environment. Next, you'll learn to work with images, as well as Docker containers and how to link and manage them. After that, you'll discover how to get a fully-functional development environment up and running, both locally and in the cloud. By the end of this course, you'll be able to increase your productivity and create lightweight apps that run the same no matter the environment.

About the author
About the author

Dan Wahlin founded Wahlin Consulting, which provides consulting and training services on JavaScript, Angular, Node.js, C#, ASP.NET MVC, Web API, and Docker. He is a Google GDE, Microsoft MVP and Regional Director, and speaks at conferences and user groups around the world.

More from the author
More courses by Dan Wahlin
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Welcome to the Docker for Web Developers course. My name is Dan Wahlin, and I'm a web developer and software architect and really excited about the potential that Docker offers us as web developers. Now any time you start with a new technology, you want to know the benefits that it's going to bring you, and we're going to start with that at the very beginning of the course. From there, we'll jump in to installing Docker on a Windows machine and on a Mac and learn about the tools and commands you can use to work with Docker, including key Docker client commands you can run, such as docker pull, which will pull images from Docker Hub. We'll learn about what an image is, how you can convert that into a running container, and how the layered file system plays a role behind the scenes. By the time we're done, we'll have an entire development environment set up using something called Docker Compose. And this is a really powerful technology for the development environment, and you'll see the process from start to finish of building a fully-functional website. So we have a lot of great stuff to cover in this course. As I said, I'm really excited about the technology, so let's jump into the official agenda for the course.

Why Use Docker as a Developer?
Docker gets a lot of attention nowadays, and for good reason, but if you've looked into it all, you might have wondered what exactly is it, and is it something I can actually use as a web developer? I know when I first started reading about it, hearing about it at conferences and user groups talks and things like that, I really wondered if it was something that even played a role in what I did, and the more I dug in, the more I found out that, yeah, it actually can play a big role in our web development operations, and that's what we're going to address in this first module. So we're going to start off by talking about what exactly is Docker, and we'll clarify some key terms and concepts that you need to know in order to be successful to understand how Docker works and how you can use it. Now from there we'll jump right into the benefits that Docker could provide us as web developers, and you're going to see there's actually quite a few benefits that it can provide us, a lot of great stuff there. Next up we'll talk about the Docker tools and the role that they each play in this overall development workflow that we're going to be discussing throughout the course. And then we'll wrap up by seeing Docker in action, and I'll actually show an application that's using Docker to hit a database, do some caching, and some other aspects of a normal development workflow and development application. So let's go ahead and get started by answering that all-important question of, what is Docker, and then jump into the benefits it can offer us as developers.

Setting up Your Docker Environment
In this module, we're going to take a look at how we can get our Docker environment set up so that we can work with the different images and containers that we're going to be discussing throughout the rest of this course. So we'll start things off by talking about how to get Docker installed on Mac, and I'll introduce something called Docker CE, Docker Community Edition. Now, we're also going to look at how you install Docker on Windows. And with Windows, you actually have to choose a different version of Docker. So if you're on Windows 7 or 8, you're going to be installing Docker Toolbox, whereas if you're on Windows 10 Pro or higher, you can use Docker Toolbox, but most people are going to want to go with something called Docker Community Edition, a very similar version to what people on a Mac would want to run. Now, once we explain those differences, talk about how to get things installed on Mac and Windows, we'll also talk about something called Docker Kitematic. Now, most of what you do with Docker is command line, but Docker Kitematic is a GUI type of tool that'll let you view images that are up on something called Docker Hub, pull those down to your machine, and then run them as containers. We're going to introduce what Docker Kitematic is, and then I'll show you a quick example of Docker Kitematic in action and how we can actually pull down some different images out there and get them running on our machines. So let's go ahead and get started by discussing how to get Docker installed on a Mac.

Hooking Your Source Code into a Container
We've learned how to work with images and containers in Docker, but we haven't seen how to hook our source code into a container. So that's going to be the focus of this module. Now we're going to start off by introducing something called the layered filesystem, and this plays a really critical role with your images and any running containers that you have. So as you want to, for instance, write to a log file, or have database files, or even work with source code, it's important to understand how Docker actually works with files. Now once we talk about that, I'll introduce a term called volumes. Volumes are really important, especially as you work with your source code if you want to get that source code hooked into a running container, so I'll introduce it here, and then we'll talk about Docker Client commands that you can use to actually create a volume. Now from there, I'm going to show you some actual examples of hooking real source code into running volumes, and I'll show all the tools to even create the source code from scratch, get that up into a volume that's associated with a running container and how everything works there. And then once we're done with those demonstrations, I'll show you how we can with just a really simple command remove a volume that might be associated with a running container. So the big question that we're going to answer in this module is how do you get your source code into a container? Because that's really what we're after here. And it turns out there's actually multiple answers. We're going to focus on this first one, how do you create a container volume that points to your source code? And that's what I'll address and show you how to do. Now later in the course, I'm also going to show you how you can add your source code into a custom image that can then be used to create a running creator, and I'll show the tools and how all that works as well. But for now, we're going to focus on container volumes, and I'm going to show you how we can get started using those and how the filesystem works.

Building Custom Images with Dockerfile
Up to this point in the course, you've worked a lot with images and containers, but they've been images that were hosted up on Docker Hub, and we've pulled those down. In this module, we're going to focus on building custom images, and you're going to learn about a special text file called a Dockerfile and learn about some of the instructions that you can put in that. So let's jump into the full agenda. So we're going to start off by talking about what a Dockerfile is, and I'll introduce some of the key instructions you're going to need to know about and explain the general process of how it works for building custom images. From there, we're actually going to create several types of custom Dockerfiles, we'll see the different instructions, and we'll do that on Windows and on Mac. Then we're going to learn some Docker Client commands we can run to build a custom image and tag it. And then finally, once we're all done with multiple images, we'll talk about how we can publish an image up to Docker Hub to make it available for us on any other machine, for other team members, or even for the general public if you want. Now the main question that we're trying to address in this module and some others is how do you get source code into a container? And one way we've already learned about. You can create a volume, and you can have a volume that points to your source code on your local development machine, and that's great when you're working in development mode. But in this module, we're going to see how we can actually get our source code into a custom image. That way that image could be used by other team members or anyone out there in the public if we wanted to set it up that way. So let's go ahead and get started by talking about what is a Dockerfile and what are some of the instructions you need to know to create a custom Dockerfile?