Chapter 6 - Docker: a Defacto Platform for Microservices Architecture
The Web materials and resources of Chapter 6 are listed here.
Chapter 6, Docker: a Defacto Platform for Microservices Architecture
Chapter 6, Docker: a Defacto Platform for Microservices Architecture. To leverage the benefits of the microservices architectural style, one needs to use technologies aligned with the characteristics of microservices. Containerization has become a popular deployment format for microservices, and Docker is the leading container platform that packages everything needed to deploy and run microservices (i.e., code, libraries, settings, etc.).With a lot of advantages, Docker become the best fit to implementing microservices architecture. In this Chapter we will dive deep in Docker to see how Docker can effectively help in leveraging microservices architecture. It is mainly intended at laying a solid foundation for the philosophy of containers and microservices that is unlikely to change, no matter what Docker looks like in the coming months and years.
📚 ToRead
Objectives : Acquire a deep introduction to the fundamentals of working with Docker. You will learn how to use Docker effectively, you’ll also grasp how it works, how each detailed feature of Docker ecosystem is meant to be used. You will have the fundamental skillset required to learn advanced topics more quickly if you wish to go further with containerized ventures.
- From Docker Deep Dive, ZERO TO DOCKER IN A SINGLE BOOK by Nigel Poulton, ed. 2018
- From Docker Deep Dive, ZERO TO DOCKER IN A SINGLE BOOK by Nigel Poulton, ed. 2020
- Chap 1-14. All.
- From Docker in Action, Second ed. 2019
- Chap 1-5,7-9,11-13. All.
- From Docker in Action, first ed. 2016
- Chap 1-5,7-8,11-12. All.
- From Docker Orchestration. 2016
- Chap 2. Building Multi-Container Applications with Docker Compose.
- Chap 4. Orchestration with Docker Swarm.
- From Learning Docker, Second Edition, Faster app development and deployment with Docker containers, 2017
- Chap 1-8. All.
- From Learn Docker, Fundamentals of Docker 19.x 2020 Packt Publishing
- Chap 1-5,10-13. All.
- From Mastering Docker, Second Edition, Master this widely used containerization tool, 2017
- Chap 1-7. All.
- From Mastering Docker, Fourth Edition, Master this widely used containerization tool, 2020
- Chap 1-5,8-9. All.
📝 ToDo
The objective of this section is to prepare our personal or working environment to work efficiently and effectively with Docker. We will discuss in detail how to set up an ideal environment that can be used when working with Docker containers.
Running lecture demos :
In order to run the various lecture demos and examples, you will need either to install Docker Desktop or use PLAY WITH DOCKER (PWD). There are lots of ways and places to install Docker on Windows, Mac, and Linux. You can install it in the cloud, on premises, and on your laptop. You will also need also to sign up for a Docker hub account https://hub.docker.com/signup.
To get the most out of this chapter, you will need a machine capable of running Docker. This machine should have at least 8 GB RAM and 30 GB HDD free with an Intel i3 processor or above, running one of the following OSes:
- macOS High Sierra or above
- Windows 10 Professional/Enterprise/Education (does not work with Home edition)
-
Ubuntu 18.04 or above
-
Docker Desktop
Docker Desktopon Windows requires 64-bit version of Windows 10 Pro/Enterprise/Education (does not work with Home edition). Hardware virtualization support must be enabled in your system’s BIOS The Hyper-V and Containers features must be enabled in Windows. For a most updated version of installation procedure, follow the installation as explained on docker official web site or refer toChapter 1from Mastering Docker, Fourth Edition, Master this widely used containerization tool, 2020. -
PWD In case installation on your machine is not possible, you can use [https://labs.play-with-docker.com/] (https://labs.play-with-docker.com/)
PLAY WITH DOCKER (PWD). It provides a free-to-use fully functional Docker playground that lasts for 4 hours. You can add multiple nodes and even cluster them in a Swarm. Sometimes performance can be slow, but for a free-to-use service it is excellent. - Docker HUB Account The home page, which can be found at [https://hub.docker.com] (https://hub.docker.com), contains a Sign-Up form and, at the top-right, an option to Sign in. The odds are that if you have been dabbling with Docker, then you already have a Docker ID. If you don’t, use the Sign-Up form on the home page to create one. If you already have a Docker ID, then simply click Sign in. Once logged in, you will be presented with the main Dashboard.
Running online tutorials:
Scenarios than you can practice:
O’reilly KATAKODA : Learn Docker & Containers using Interactive Browser-Based Scenarios
- Deploying Your First Docker Container
- Deploy Static HTML Website as Container
- Building Container Images
- Dockerizing Node.js
- Persisting DATA using volumes
Dockerhub Labs:
đź’» ToCode
You are strongly advised to run all lecture demos.
Make a print screen of the following tasks; send them using microsoft teams with your Dockerhub account URL :
-
Create an account with your real name and last name on Dockerhub. Make a print screen of your account.
-
Execute
docker image lsin your terminal on your computer and make a print screen of the command result. Once you have done course demos, you should have at least the following images on your machine:
- hello-world
- nginx
- busybox
- kodekloud/simple-prompt-docker
- ubuntu
- jpetazzo/clock
- alpine
- redis
- etc.
-
Execute
docker ps -ain your terminal. This command should list all created containers so far. -
Follow the steps given in our course content in
DOCKERIZING AN APPLICATION HOW TO CREATE YOUR OWN IMAGEsection (slide 233); create an image namedweband push its repository to your docker hub. Share with me the repository address. It should be something like this : https://hub.docker.com/repository/docker/neilabenlakhal/web but with your name instead. Make a print screen of your DockerHub repository. you should submit a print screen like (Slide 258). -
Execute the containerized Web App and make a print screen of the execution : you should have a result like in (slide 257).
-
Create an image of the Flask Web App, see (slide 259). Once done, run the built image (from a browser) like (slide 266). Show image published to DockerHub like (slide 269).
-
Execute
Docker volume lsand list createdvolumeslike (slide 369). -
Execute
Docker network lsand list created networks.
Bonus tasks:
-
Dockerize the visit counter Web App using docker compose. You should reproduce the same results as (slide 417).
-
Create a multi-node swarm, create a service in the swarm using nginx image, check service is successfully deployed in the swarm and provide an invocation test like (slide 480).
-
Deploy a Multi-service Application stack, images to be used are listed in (slide 521). Show that the application is running and provide successful execution print screens like (slide 525).