
This video will give you an overview about the course.
See how containers works in the bridge networking mode, which is the default mode.
• Create and run a container
• Inspect the container’s network properties
• Show the use cases for port forwarding
Introduce the host networking mode and the difference between it and the bridge one.
• Create and run a container in the host networking mode
• Establish a connection with the service running inside the container
• Notice that we are able to communicate without using port forwarding
Demonstrate container behavior, when running in the none network mode and its use cases.
• Create and run a container using BusyBox image
• Ensure that the container is running in the none network mode
• Terminate the container
In this video, create a Docker network, create two containers, and attach them to this network. Also, demonstrate how they can communicate internally.
• Create a Docker network
• Create two containers and ensure that they use our user-defined network
• Demonstrate how they can reach each other internally
In this video, demonstrate the difference between the ADD command and the COPY command in the Dockerfile.
• Create a Dockerfile and use the COPY command, and also build and show the results
• Create a number of files that need to be copied and also, use the ADD command
• Demonstrate other usages for the ADD command
Here, show the image cache feature of Docker, when to use it, and when to avoid it.
• Create a new Dockerfile and download content using Git
• Show how caching enhances the build speed but also ignores changes done on the repo
• Add the “--no-cache” option to avoid caching the downloaded content
Show the usage of the onbuild tag that the allows the user to write less code for common Dockerfile steps. You can build an API image, with only two lines of Dockerfile.
• Create the Flask app
• Create the Dockerfile for the image
• Use the onbuild tag, to decrease the steps needed to build the image
Here, demonstrate how to launch GUI applications from Docker containers. Firefox would be used as an example.
• Launch a VirtualBox machine and install the necessary prerequisites
• Create the Dockerfile that launches the browser
• Run the container passing in the correct command line parameters to activate the browser
Demonstrate the different kill signals that can be sent to a running container, and how to deal with stopped containers that think they are still running (also known as zombie containers).
• Create the necessary Bash Script
• Create the container, that will serve the script
• Show the difference between the kill signal and the stop signal
Introduce the Docker Machine tool, and also how it can be used to run containers remotely on VirtualBox machines.
• Install Docker Machine and activate it
• Create the VirtualBox machine using Docker Machine
• Use Docker Machine to run and manage containers on the virtual machine
Use Docker Machine to manage containers on Cloud providers. AWS is presented as an example.
• Use Docker Machine to create the EC2 instance remotely
• Configure Docker Machine to connect to the EC2 instance
• Run a simple web server on a docker container, using Docker Machine
Deploy WordPress using the traditional way (without using Docker), and demonstrate the drawbacks of this technique.
• Install the prerequisites
• Install MySQL
• Deploy and run WordPress, and notice how hard it is to replicate this setup to other machines
Start the microservices architecture by deploying MySQL, using a Docker container.
• Create a directory and copy the binary data files of the previous MySQL installation
• Create the Dockerfile and add the data files to the image
• Build, run, and push the image to Docker Hub
Complete the microservices architecture by adding the WordPress container to the stack.
• Create a directory and copy the web files from the previous WordPress installation
• Create the Dockerfile and add the web files to the image
• Build and push the image. Start a new server and run the entire stack. Notice, that it only takes a few seconds to replicate the setup
Demonstrate how we can deploy the API stack natively without Docker.
• Install the prerequisites
• Install MongoDB
• Deploy and run the application, and also make a few API calls
Here, you will see how to dockerize the API stack and show how the process saves deployment time.
• Create the Dockerfile
• Add the necessary prerequisites
• Build, run, and push the image, and also make some API calls, for checking the application sanity
In this video, we shall learn to install Docker Compose, and also get introduced to its basic commands.
• Install docker-compose
• Verify the installation
• Get introduced to the Docker Compose file
Transform the existing WordPress Docker deployment to use Docker Compose.
• Create the Docker Compose file for WordPress
• Bring the services up
• Investigate the services’ status using Docker Compose subcommands
Use Docker Compose to orchestrate the Node.js services.
• Create the Docker Compose file
• Deploy the services
• Ensure that the API responds correctly to the HTTP requests
Get introduced to know Docker Swarm, initialize the cluster, and examine the instructions file.
• Initialize Docker Swarm
• Get to know the Docker Compose file
• Deploy the Node.js API on multiple hosts
Add a middleware layer to the API stack, in order to demonstrate a real-world microservices architecture.
• Clone the Python API
• Update the Docker Compose file to include the middleware
• Instruct the Docker Swarm to update the deployment and test it
Add a new node to the cluster, and examine what happens if one of the nodes goes down. Also, demonstrate how to scale up the services.
• Add a new node to the cluster
• Bring down one of the old nodes
• Ensure that the cluster moves the containers to a new healthy node
Run Docker without a root.
• Install Docker
• Add the current user to the Docker group
• Ensure that the current user can run docker commands without using sudo
Create a number of containers and show how we can remove all of them or only the ones in exited mode.
• Create a number of containers, some of which are intentionally failing
• Use docker with xargs to remove all container
• Use the filter option to select only exited containers to remove
Show how to automatically remove volumes with no parent containers (also called as orphaned volumes).
• Create a container with an anonymous volume
• Use the Docker rm -v command, to remove the container
• Ensure that the volume that was associated with the container was automatically deleted
Create a container with the main process set to Bash. Also, show how you can exit from the shell, keeping the container running.
• Create an ubuntu container and run Bash as the main process
• Exit from the container using a specific key sequence
• Ensure that the container is still running in the background
Deploy Docker Portainer and demonstrate how it can be used to manage Docker infrastructure.
• Deploy Docker Portainer
• Navigate to the main page and create a user
• Visit the different management options of the tool
Create a container and a Bash Script, that will confirm whether or not, it is being invoked inside a Docker container.
Create a container and open a Bash Shell
Create the Bash Script
Run the Bash Script inside and outside the container
You’ve been using Docker to wrap your code into small containers or packets, along with everything that would be required for the code to run, following which you ship code to any system and deploy it easily. Now you want to go further and use Docker to boost productivity. You’ve come to the right place!
This course takes you through the different types of built-in network elements and how to create custom networks. You’ll learn how to link different Docker containers to enable them to talk to each other. Also, you’ll learn to connect multiple Docker containers with the help of custom networks. Next, you’ll learn how to define and run multi-container Docker applications with the help of the Docker Compose tool.
Moving ahead, you’ll learn to deploy WordPress, MongoDB, and MySQL server using Docker. Also, you’ll learn to split an application into separate services that are loosely tied together, so they can be scaled vertically or horizontally. Finally, you’ll explore how to use service discovery mechanisms to allow a Docker container to auto-discover other containers and communicate with them.
About the Author
Ahmed El-Fakharany is a senior Cloud and DevOps engineer. He’s worked with Linux and open-source technologies since 2011. Having held various job titles both in the enterprise world as well as in small and medium-sized start-ups, Ahmed has experienced the whole lifecycle of software creation and maintenance start to finish.
He has also taught many students various DevOps tools such as Docker, Ansible, Chef, Vagrant, Jenkins, as well as AWS cloud technologies such as EC2, S3, Beanstalk, and Lambda functions. Ahmed is a certified AWS Solution Architect Associate.