The Complete Practical Docker Guide

Video description

Docker is a software framework for building, running, and managing containers on servers and the cloud. In this course, you’ll start by installing Docker on your computer - macOS, Windows, or Linux. Afterward, you’ll jump into tons of practice activities and use different Docker features. You’ll pull different Docker images and run multiple containers using them.

In practice sections, you’ll perform multiple practice Docker activities, such as running Docker containers in the foreground and background, then connecting to certain processes in Docker from the terminal. After that, you’ll learn to expose internal container ports to the outside and add environment variables for containers. You’ll also create custom names and hostnames for containers, create a custom bridge network and run multiple containers inside of it, communicate between containers, and persist container folders using volumes mapping.

Next, you’ll also learn and practice how to use different Docker images (view and edit them). For that, you will not use the terminal; instead, you’ll use the GUI application Visual Studio Code.

By the end of this course, you’ll gain fundamental practical knowledge of Docker and be able to easily use it for the development and testing of your applications.

Most importantly, you’ll understand Docker’s main features such as Docker Volumes, Docker networking, and environment variables.

What You Will Learn

  • Learn how to use Docker images and create containers
  • Manage Docker containers: start, stop, prune, restart
  • Enable port mapping and expose container ports to outside
  • Run Node and Python applications using Docker containers
  • Create environment variables for Docker containers
  • Create custom bridge networks and run multiple containers

Audience

This course is for anyone who is interested in learning about Docker and its components via practical projects. Any software developer who wants to develop, ship, and run their applications in their regular day-to-day work can highly benefit from this course.

There are no specific requirements, just a desire to make your hands dirty and learn Docker by doing it. Any OS (macOS, Windows, or Linux) will work to get started with this course.

About The Author

Bogdan Stashchuk: Bogdan Stashchuk is an experienced instructor (over 20+ years) with a software engineering background. He teaches complex stuff in an easy step-by-step manner. All his courses include practical exercises, which allow the learners to follow him from the start of any course till the end. Learners will perform all tasks the same way he does in his video lectures. There are a lot of challenging assignments, the solutions for which are discussed inside the course. This is the perfect combination that enables you to really learn and retain gained knowledge for a long period of time.

Table of contents

  1. Chapter 1 : Introduction to the Course
    1. Course Overview
  2. Chapter 2 : Docker Installation
    1. Installing Docker Desktop on Mac
    2. Installing Docker Desktop on Windows
    3. Installing Docker Engine on Linux
  3. Chapter 3 : Basic Docker Container (Ubuntu, Busybox, Alpine)
    1. Running Hello-World Container
    2. Running Ubuntu Container
    3. Running Busybox Container
    4. Alpine Versus Busybox Images
  4. Chapter 4 : Port and Volume Mapping in the Docker Containers
    1. Running Nginx with Exposed Port
    2. Nginx Container with Custom Content
    3. Adding Favicon to the Project
    4. Using Path Variable in Volume Mapping
  5. Chapter 5 : Docker Containers Management (Ubuntu, Nginx)
    1. Running Containers in Background
    2. Running Container with Pseudo TTY
    3. Creating Multiple Ubuntu Containers from the Same Image
    4. Running Multiple Nginx Servers
    5. Cleaning Up Stopped Containers
  6. Chapter 6 : Running Python Applications in Docker
    1. Creating Python Containers
    2. Simple Python Program
    3. Challenge: Simple Python Calendar App
    4. Challenge Solution: Simple Python Calendar App
  7. Chapter 7 : Running Node.js Applications in Docker
    1. Running Node.js Containers
    2. Hello World Application with Node
    3. Express Web Server Using Node
    4. Add Handling of the SIGINT and SIGTERM Signals
    5. Challenge: Create Files Handling Node App
    6. Challenge Solution: Create Files Handling Node App
    7. Conclusion - Containers can Create and Modify External Files
  8. Chapter 8 : Running MongoDB Containers
    1. Pulling Mongo Image and Creating the First Mongo Container
    2. Starting Additional Processes in the Running Container
    3. What is Entry Point and Where is it Located
    4. Creating New Mongo Database Using Mongo Shell
    5. Running Mongo Container with Persistent Database
  9. Chapter 9 : Communication Between Containers and Environment Variables (MySQL, phpMyAdmin)
    1. Starting WordPress Container
    2. Plan for the Next Lectures - Networks and Environment Variables
    3. Default Bridge Network and Communication Between Containers
    4. Exploring Environment Variables
    5. Starting MySQL Container with env Variable
    6. Launching Another phpMyAdmin Container
    7. Connecting phpMyAdmin to MySQL Container
    8. Making Notes of the Commands
  10. Chapter 10 : Default and Custom Bridge Networks in Docker (WordPress, MySQL)
    1. Communication Using Hostnames in the Default Bridge Network
    2. Inspecting Default Bridge Network
    3. Creating New Custom Bridge Network
    4. Creating Busybox Containers in the Custom Network
    5. Using Custom Persistent Names for Connectivity in the Custom Network
    6. MySQL and phpMyAdmin in the Custom Network
    7. Challenge: WordPress with MySQL and phpMyAdmin
    8. Challenge Solution: WordPress with MySQL and phpMyAdmin - Part 1
    9. Challenge Solution: WordPress with MySQL and phpMyAdmin - Part 2
    10. Summary for the WordPress and MySQL Setup
  11. Chapter 11 : Additional Containers – Elasticsearch, Redis, Httpd
    1. Getting Docker Image with Curl Utility
    2. Challenge: Run Elasticsearch and Curl Containers in the Custom Network
    3. Challenge Solution: Run Elasticsearch and Curl Containers in the Custom Network
    4. Inserting Documents into Elasticsearch Index
    5. Starting Redis Container
    6. Challenge: Redis and Redis-Commander
    7. Challenge Solution: Redis and Redis-Commander
    8. Launching Httpd Container
  12. Chapter 12 : Docker on Practice Summary and Introduction to the Docker Fundamentals
    1. Docker Fundamentals Practical Section Summary
    2. Introduction to the Docker Fundamentals
  13. Chapter 13 : What is Docker and Docker Components
    1. Virtual Machines Versus Docker Containers
    2. Virtual Machines Architecture
    3. How I Use Virtual Machines
    4. My Computer Just Ran Out of Memory
    5. Docker Containers Architecture
    6. How Docker is Running on Different Operating Systems
    7. Container Processes and Resources
    8. Docker Components: Overview
    9. Docker Client
    10. Docker Server
    11. Docker Host
    12. Docker Image
    13. Docker Container
    14. Docker Repository
    15. Docker Registry
    16. Docker Components: Summary
  14. Chapter 14 : Introduction to the Images and Containers
    1. Docker Commands Versus Management Commands
    2. Alternative Commands
    3. Basic Container and Images Commands
    4. Cleaning Up My Docker Setup
    5. Pulling Images from Docker Hub
    6. What is Docker Image
    7. Creating New Container from the Image
    8. What is CMD in the Docker Image
    9. What is Docker Container
    10. Summary for the Introduction to Images and Containers
  15. Chapter 15 : Getting Started with Linux
    1. Why You Need to Know Linux while Studying Docker
    2. Introduction to the Linux Section
    3. Possible Options to Use Linux on macOS and Windows
    4. Creating Linux Container Using Docker
    5. What is Shell, Terminal, and Command
    6. Getting Information about Linux Computer
    7. How Shell Understands that You Have Entered a Command
    8. Getting Help about Commands Using Man Utility
    9. Command Options
    10. Command Arguments
    11. Arguments for Options
  16. Chapter 16 : Processes in Linux
    1. What Are Processes
    2. List Running Processes
    3. Starting Additional Processes and Killing Processes
    4. Installing htop Package Using apt-get
    5. Using the htop Utility
    6. Summary for Processes Monitoring
  17. Chapter 17 : Data Streams and Piping in Linux
    1. Data Streams of the Process
    2. Redirecting STDOUT and STDERR to the File
    3. Where Process Data Streams Send Data by Default
    4. How to Send Data to STDIN and Redirect STDOUT and STDERR
    5. Piping
    6. Summary for Data Streams and Piping
  18. Chapter 18 : Files and Directories Management in Linux
    1. Introduction to Files and Directories Management
    2. Linux File System Structure and Navigation
    3. Listing Files and Directories
    4. Exploring Subdirectories of the Root Directory
    5. Creating and Removing Directories and Files
    6. Creating New Files
    7. Editing Files Using Vim and Nano Editors
    8. Copy and Move Files and Directories
    9. Reading Files
    10. Filtering Text Using the grep Command
    11. Soft Versus Hard Links
    12. Creating Hard and Soft Links
  19. Chapter 19 : Search Operations in Linux
    1. Introduction to the Find Command
    2. Searching Files Using the Find Command
    3. Some Other Examples of the Find Command
    4. Executing Additional Commands Inside of the Find Operation
    5. Xargs Command
    6. Piping Results of the Find Command to the Other Command Using Xargs
  20. Chapter 20 : Compressing and Sorting in Linux
    1. Overview of the tar and gzip Utilities
    2. Creating and Extracting Compressed Archive Using tar and gzip
    3. Sorting Files Using Ls Command
    4. Sorting Contents of the Files Using Sort Utility
  21. Chapter 21 : User Management and Permissions in Linux
    1. Introduction to the User Management in Linux
    2. Creating Users Using useradd Command
    3. Creating New User Using adduser Command
    4. Changing Ownership of the File
    5. Changing Permissions
  22. Chapter 22 : Executable Files and Scripting in Linux
    1. Creating Executable Script
    2. Adding Path to the Scripts into the PATH Variable
    3. Summary for Users, Permissions, and Scripts
  23. Chapter 23 : Networking in Linux
    1. Introduction to the Linux Networking
    2. Exploring IP address settings
    3. Verifying Connectivity with Remote Servers
    4. Enabling SSH on the Linux Server
    5. Connecting to the Linux Server Remotely Via SSH
    6. Using curl and wget Utilities
  24. Chapter 24 : Environment Variables in Linux
    1. Environment Variables
    2. SOLUTION - Script with Environment Variables Access
    3. Linux: Summary
  25. Chapter 25 : Launching Course Project Application without Docker
    1. Introduction to the Dockerfiles and Docker Compose
    2. Cloning Remote Docker Repository with Project Files
    3. Project Overview
    4. Getting Unsplash API Key
    5. Installing Node.js and NPM
    6. Installing Python, Pip, and Pipenv on macOS
    7. Installing Python, Pip, and Pipenv on Windows
    8. Starting Frontend App Using NPM
    9. Starting API Application Using Python
    10. Verifying How Images Gallery Project Works
    11. Summary for Start of the App without Docker
  26. Chapter 26 : Building Custom Images Using Dockerfiles
    1. Initializing Git and GitHub for the Project
    2. Installing Docker and Hello-World Using Docker
    3. Creating Dockerfile for the Python API Service
    4. Building Docker Image for the API Service
    5. Running API Containers Based on the Built Docker Image
    6. Analyzing API Docker Container from Inside
    7. Docker Image for the API Service: Summary
    8. Creating Dockerfile for the Frontend Application
    9. Building Docker Image for the Frontend App
    10. Running Docker Container for the Frontend Service
    11. Exploring Frontend Container from Inside
    12. Why You Need to Have the node_modules Folder and Python venv Folders Locally
    13. Running Both Frontend and API Containers in Background
  27. Chapter 27 : Launching Multiple Services Using Docker Compose
    1. Creating a Basic docker-compose File
    2. Bringing Up Both Containers Using docker-compose
    3. How to Operate Containers Using docker-compose
    4. Creating Volumes Mapping for the Frontend Service
    5. Fix Volumes Sync in the React Container
    6. Enabling Volumes Mapping for the API Service
    7. Enabling auto-restart and docker-compose Summary for API and Frontend
    8. Why Do We Need Mongo and mongo-express Services
    9. Mongo and mongo-express Official Docker Images Overview
    10. Adding Mongo and mongo-express Services to the docker-compose File
    11. Starting All Services Including Mongo and mongo-express Using docker-compose
  28. Chapter 28 : Exploring Docker Compose Setup
    1. Docker Desktop Overview
    2. Using Mongo Shell and mongo-express GUI
    3. MongoDB Data is Now Deleted after docker-compose Restart
    4. Configuring Persistent Data Volume for the Mongo Container
    5. Verifying Persistent MongoDB Storage Using Volume
    6. Mongo and mongo-express Setup Summary
    7. How docker-compose Containers Communicate with Each Other
    8. Exploring Networking Between Docker Containers
  29. Chapter 29 : Course Summary
    1. Docker Complete Guide Summary

Product information

  • Title: The Complete Practical Docker Guide
  • Author(s): Bogdan Stashchuk
  • Release date: December 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781803247892