The course is part of these learning paths
Welcome to Introduction to Docker! In this course, you'll learn the foundations of using Docker. You'll learn about images and containers, port mapping, Docker networks, volumes, tagging, and more. By the end of the course, you should be comfortable with the basic functionality of Docker.
Containers have existed in some form for a while now. However, it was Docker that brought them into the mainstream. And Docker containers have become synonymous with the word "container" because of their popularity. Docker containers have made it easier for many developers and operations teams to build, ship, and deploy their code.
While Docker containers may only be a transitional technology between virtual machines and unikernels (or something similar), they currently remain one of the more effective ways to ship code, which is why having an understanding of Docker has become almost a requirement for technical engineers.
- You should understand what Docker is
- You should understand how to create Docker images
- You should understand how to map ports between Docker and the Host OS
- You should understand the basics of Docker networking
- You should understand how to use volumes for persistent storage
- You should be able to tag images
- DevOps engineer
- Site reliability engineer
- Operations engineer
The course assets
Docker installation instructions
If you want to use Vagrant
The IDE used in the course
A Dockerfile reference
Tooling for the Go language used in the demos
Welcome back. We've covered a lot throughout the course, so let's wrap up the course by summarizing what we've learned. In the first two lessons, we talked about Docker at a pretty high level. We covered what it is, and we talked about its architecture. Some topics are a bit of a chicken and egg type of scenario, as in it's difficult to explain one without first explaining the other, in a circular logic sort of endless loop.
Now that you've seen Docker a bit, and you have some familiarity with it, the architecture should make a bit more sense. The gist of that lesson was to explain that Docker isn't like a virtual machine; rather, it allows you to run processes in an isolated way, using several Linux kernel features. Now, it may be worth going back and re-watching the architecture lesson again so that it kind of ALT clicks now that you have some familiarity with Docker.
After that, we installed Docker on CentOS, and created a container. Creating a container is just a simple command, however, behind the scenes there's a lot going on. Docker tries to find the image locally. If it can't, it attempts to download it from a Docker registry, and once the image is on the local host, then it can create containers based off of that image.
And Docker also allows you to use the I and T flags so that you can interact with the processes running inside of the container. After creating the container, we talked about the difference between a container and an image. The difference being that a container is a running instance of an image; similar to how an executable becomes a running process.
Then we went on to cover creating images via the Dockerfile, and via Docker Commit. Creating your own images allows you to bundle up just what you need for your app. Now, there are a lot of best practices for creating images, and we didn't really get into them. However, practices such as keeping the images as small as possible, using official public images as base images, and ensuring images have one purpose, as well as reducing the number of layers, are just a few best practices.
After creating some basic images that run simple binaries, printing out text to standard output, we tested a web application. With the webapp we get to see how ports work, and how to dynamically and explicitly set them. And we tested out three different networking options. Tested out bridge networks, which are the default if you don't specify one.
Bridge networks allow containers to start in their own network that's connected to the interfaces of the host OS. The default bridge network isn't very customizable, however, you can create your own if you need to make some changes. We covered volumes after that. Docker provides three different storage options.
Volumes are the newest and most versatile because they also can allow you to specify your own driver to use. The drivers allow you to have different storage options, such as S3, Google Cloud Storage, or others, in place of local disc storage. We also covered the original option called, bind mounts, The difference between bind mounts and volumes is that volumes are managed by the Docker engine.
Bind mounts aren't, and that requires you to know where on disc that mount is located. The final option was the temporary file system, named TempFS, which is an in memory option that lasts while the container is running. The final lesson covered tagging a bit more in depth. Tagging is important, and in production it matters how you tag things.
Following a strict procedure for tagging ensures that you're going to be able to deploy the correct version, and then roll back if needed. And while it's important, there's no single strategy that's going to work for everyone. So it's important to find a strategy that works for your team. At the start of the course, I listed off some learning objectives.
I said, by the end of the course, you should understand what Docker is. You should understand how to create Docker images. You should understand how to map ports between the Docker host, and the Docker container. You should understand the networking basics. And you should understand how to use volumes for persistent storage.
And finally I said that you should be able to tag images. Now having made it this far, you should feel comfortable with each of these objectives by now. So, what's next? What comes after all of this? Next, I recommend that you try this stuff out for yourself. Hands on experience is the best teacher. So, I recommend that you try out our Docker Labs, and that you try installing this locally, and follow some of the examples.
When you've gone through the examples, try and create some of your own. If you have some source code that you want to try and bundle up, I think that's the best way to learn, is seeing how things that you already are familiar with will work inside of a container. Docker is a technology that continues to evolve, so depending on when you see this course, things may have changed.
If part of the changes introduce errors, then I want you to try and work through them. These are the sorts of errors that you're going to run into in the real world. So, take the opportunity to understand why the error is happening, and it's going to give you a better depth of knowledge into Docker. All right, let's wrap up the course here.
As I mentioned at the start, I enjoy hearing from you guys. If you don't provide me with the feedback about what you dislike, and what you like, I can't improve upon the content. So, feel free to reach out to me via firstname.lastname@example.org, or on Twitter, I'm @sowhelmed. That's gonna do it for this course.
Thank you so much for watching. I hope that this has been useful to you. I had a lot of fun making it, and I hope that you've enjoyed it. I'm Ben Lambert. From Cloud Academy and myself, thanks for watching.
About the Author
Ben Lambert is a software engineer and was previously the lead author for DevOps and Microsoft Azure training content at Cloud Academy. His courses and learning paths covered Cloud Ecosystem technologies such as DC/OS, configuration management tools, and containers. As a software engineer, Ben’s experience includes building highly available web and mobile apps. When he’s not building software, he’s hiking, camping, or creating video games.