Skip to content

Commit dbbeae9

Browse files
mvelosopBillWagner
authored andcommitted
Cross updating with Microservices eBook v2.1.02 - Chapter 2 (#7415)
* Cross updating with eBook v2.1.02 * Fixed revision date, add image captions. * Fixed, Windows host CAN run Linux containers
1 parent 69fd930 commit dbbeae9

File tree

4 files changed

+77
-38
lines changed

4 files changed

+77
-38
lines changed

docs/standard/microservices-architecture/container-docker-introduction/docker-containers-images-registries.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ title: Docker containers, images, and registries
33
description: .NET Microservices Architecture for Containerized .NET Applications | Docker containers, images, and registries
44
author: CESARDELATORRE
55
ms.author: wiwagn
6-
ms.date: 05/26/2017
6+
ms.date: 08/31/2018
77
---
88
# Docker containers, images, and registries
99

1010
When using Docker, a developer creates an app or service and packages it and its dependencies into a container image. An image is a static representation of the app or service and its configuration and dependencies.
1111

12-
To run the app or service, the apps image is instantiated to create a container, which will be running on the Docker host. Containers are initially tested in a development environment or PC.
12+
To run the app or service, the app's image is instantiated to create a container, which will be running on the Docker host. Containers are initially tested in a development environment or PC.
1313

14-
Developers should store images in a registry, which acts as a library of images and is needed when deploying to production orchestrators. Docker maintains a public registry via [Docker Hub](https://hub.docker.com/); other vendors provide registries for different collections of images. Alternatively, enterprises can have a private registry on-premises for their own Docker images.
14+
Developers should store images in a registry, which acts as a library of images and is needed when deploying to production orchestrators. Docker maintains a public registry via [Docker Hub](https://hub.docker.com/); other vendors provide registries for different collections of images, including [Azure Container Registry](https://azure.microsoft.com/services/container-registry/). Alternatively, enterprises can have a private registry on-premises for their own Docker images.
1515

1616
Figure 2-4 shows how images and registries in Docker relate to other components. It also shows the multiple registry offerings from vendors.
1717

18-
![](./media/image5.PNG)
18+
![Basic taxonomy in Docker: The registry is like a bookshelf where images are stored and available to be pulled for building containers to run services or web apps. There are private Docker registries on-prem and on the public cloud. Docker Hub is a public registry maintained by Docker, along the Docker Trusted Registry an enterprise-grade solution, Azure offers the Azure Container Registry. AWS, Google and others also have container registries.](./media/image5.PNG)
1919

2020
**Figure 2-4**. Taxonomy of Docker terms and concepts
2121

@@ -25,7 +25,7 @@ Private image registries, either hosted on-premises or in the cloud, are recomme
2525

2626
- Your images must not be shared publicly due to confidentiality.
2727

28-
- You want to have minimum network latency between your images and your chosen deployment environment. For example, if your production environment is Azure cloud, you probably want to store your images in Azure Container Registry so that network latency will be minimal. In a similar way, if your production environment is on-premises, you might want to have an on-premises Docker Trusted Registry available within the same local network.
28+
- You want to have minimum network latency between your images and your chosen deployment environment. For example, if your production environment is Azure cloud, you probably want to store your images in [Azure Container Registry](https://azure.microsoft.com/services/container-registry/) so that network latency will be minimal. In a similar way, if your production environment is on-premises, you might want to have an on-premises Docker Trusted Registry available within the same local network.
2929

3030
>[!div class="step-by-step"]
3131
[Previous](docker-terminology.md)

docs/standard/microservices-architecture/container-docker-introduction/docker-defined.md

Lines changed: 52 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,86 @@ title: What is Docker?
33
description: .NET Microservices Architecture for Containerized .NET Applications | What is Docker?
44
author: CESARDELATORRE
55
ms.author: wiwagn
6-
ms.date: 05/26/2017
6+
ms.date: 08/31/2018
77
---
88
# What is Docker?
99

10-
[Docker](https://www.docker.com/) is an [open-source project](https://github.com/docker/docker) for automating the deployment of applications as portable, self-sufficient containers that can run on the cloud or on-premises. Docker is also a [company](https://www.docker.com/) that promotes and evolves this technology. Docker works in collaboration with cloud, Linux, and Windows vendors, including Microsoft.
10+
[Docker](https://www.docker.com/) is an [open-source project](https://github.com/docker/docker) for automating the deployment of applications as portable, self-sufficient containers that can run on the cloud or on-premises. Docker is also a [company](https://www.docker.com/) that promotes and evolves this technology, working in collaboration with cloud, Linux, and Windows vendors, including Microsoft.
1111

12-
![](./media/image2.png)
12+
![Docker containers can run anywhere, on-premises in the customer datacenter, in an external service provider or in the cloud, on Azure.](./media/image2.png)
1313

1414
**Figure 2-2**. Docker deploys containers at all layers of the hybrid cloud
1515

16-
Docker image containers run natively on Linux and Windows. Windows images run only on Windows hosts and Linux images run only on Linux hosts. The host is a server or a VM.
16+
Docker image containers can run natively on Linux and Windows. However, Windows images can run only on Windows hosts and Linux images can run on Linux hosts and Windows hosts (using a Hyper-V Linux VM, so far), where host means a server or a VM.
1717

18-
You can develop on Windows, Linux, or macOS. The development computer runs a Docker host where Docker images are deployed, including the app and its dependencies. On Linux or macOS, you use a Docker host that is Linux based and can create images only for Linux containers.(On macOS you can edit code or run the Docker CLI, but as of the time of this writing, containers do not run directly on macOS.) On Windows you can create images for either Linux or Windows Containers.
18+
Developers can use development environments on Windows, Linux, or macOS. On the development computer, the developer runs a Docker host where Docker images are deployed, including the app and its dependencies. Developers who work on Linux or on the Mac use a Docker host that is Linux based, and they can create images only for Linux containers. (Developers working on the Mac can edit code or run the Docker CLI from macOS, but as of the time of this writing, containers do not run directly on macOS.) Developers who work on Windows can create images for either Linux or Windows Containers.
1919

20-
On Windows or macOS, [Docker Community Edition (CE)](https://www.docker.com/community-edition) hosts containers in a development environment and provides additional developer tools. [Docker Enterprise Edition (EE)](https://www.docker.com/enterprise-edition) is used by IT teams who build, ship, and run large business-critical applications. Both products install the necessary VM (the Docker host) to host the containers.
20+
To host containers in development environments and provide additional developer tools, Docker ships [Docker Community Edition (CE)](https://www.docker.com/community-edition) for Windows or for macOS. These products install the necessary VM (the Docker host) to host the containers. Docker also makes available [Docker Enterprise Edition (EE)](https://www.docker.com/enterprise-edition), which is designed for enterprise development and is used by IT teams who build, ship, and run large business-critical applications in production.
2121

22-
[Windows Containers](https://msdn.microsoft.com/en-us/virtualization/windowscontainers/about/about_overview) work with two types of runtimes:
22+
To run [Windows Containers](https://msdn.microsoft.com/en-us/virtualization/windowscontainers/about/about_overview), there are two types of runtimes:
2323

2424
- Windows Server Containers provide application isolation through process and namespace isolation technology. A Windows Server Container shares a kernel with the container host and with all containers running on the host.
2525

26-
- Hyper-V Containers expand on the isolation provided by Windows Server Containers by running each container in a highly optimized virtual machine. In this configuration, the kernel of the container host is not shared with the Hyper-V Containers, providing better isolation. Hyper-V Containers allow untrusted and *hostile multi-tenant* applications to run on the same host. Hyper-V Containers have a bit less efficiency in startup times and density than Windows Server Containers.
26+
- Hyper-V Containers expand on the isolation provided by Windows Server Containers by running each container in a highly optimized virtual machine. In this configuration, the kernel of the container host is not shared with the Hyper-V Containers, providing better isolation.
2727

28-
The images for these containers are created and function the same way. They differ in how the container is created. For details, see [Hyper-V Containers](https://msdn.microsoft.com/en-us/virtualization/windowscontainers/about/about_overview).
28+
The images for these containers are created the same way and function the same. The difference is in how the container is created from the image running a Hyper-V Container requires an extra parameter. For details, see [Hyper-V Containers](https://docs.microsoft.com/virtualization/windowscontainers/manage-containers/hyperv-container).
2929

3030
## Comparing Docker containers with virtual machines
3131

3232
Figure 2-3 shows a comparison between VMs and Docker containers.
3333

34-
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
35-
**Virtual Machines** **Docker Containers**
36-
37-
![](./media/image3.png) ![](./media/image4.png)
38-
39-
Virtual machines include the application, the required libraries or binaries, and a full guest operating system. Full virtualization requires more resources than containerization. Containers include the application and all its dependencies. However, containers share the OS kernel with other containers. Containers run as isolated processes in user space on the host operating system. Except in Hyper-V containers, where each container runs inside of a special virtual machine per container.
40-
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
34+
<table>
35+
<tbody>
36+
<tr>
37+
<td style="width:50%"><p><strong>Virtual Machines</strong></p>
38+
<p><img src="media/image3.png" style="width:100%; vertical-align:top;" alt="For VMs, there are three base layers in the host server, from the bottom-up: infrastructure, Host Operating System and a Hypervisor and on top of all that each VM has its own OS and all necessary libraries"/></p>
39+
<p>Virtual machines include the application, the required libraries or binaries, and a full guest operating system. Full virtualization requires more resources than containerization.</p></td>
40+
<td style="width:50%"><p><strong>Docker Containers</strong></p>
41+
<p><img src="media/image4.png" style="width:100%; vertical-align:top;" alt="For Docker, the host server only has the infrastructure and the OS and on top of that, the container engine, that keeps container isolated but sharing the base OS services."/></p>
42+
<p>Containers include the application and all its dependencies. However, they share the OS kernel with other containers, running as isolated processes in user space on the host operating system. (Except in Hyper-V containers, where each container runs inside of a special virtual machine per container.)</p></td>
43+
</tr>
44+
</tbody>
45+
</table>
4146

4247
**Figure 2-3**. Comparison of traditional virtual machines to Docker containers
4348

44-
Because containers require far fewer resources (for example, they do not need a full OS), they start fast and are easy to deploy. Low resource usage allows higher density. You can run more services on the same hardware unit and reduce costs.
49+
Because containers require far fewer resources (for example, they do not need a full OS), they are easy to deploy and they start fast. This allows you to have higher density, meaning that it allows you to run more services on the same hardware unit, thereby reducing costs.
4550

46-
Running on the same kernel results in less isolation than VMs provide.
51+
As a side effect of running on the same kernel, you get less isolation than VMs.
4752

4853
The main goal of an image is that it makes the environment (dependencies) the same across different deployments. This means that you can debug it on your machine and then deploy it to another machine with the same environment guaranteed.
4954

5055
A container image is a way to package an app or service and deploy it in a reliable and reproducible way. You could say that Docker is not only a technology, but also a philosophy and a process.
5156

52-
Docker developers don't say, "It works on my machine, why not in production?" They say, "It runs on Docker". Docker-packaged apps can be executed on any supported Docker environment. Docker packaged apps run consistently on all deployment targets (Dev, QA, staging, production).
57+
When using Docker, you will not hear developers say, "It works on my machine, why not in production?" They can simply say, "It runs on Docker", because the packaged Docker application can be executed on any supported Docker environment, and it will run the way it was intended to on all deployment targets (Dev, QA, staging, production, etc.).
58+
59+
# A simple analogy
60+
61+
Perhaps a simple analogy can help getting the grasp of the core concept of Docker.
62+
63+
Let's go back in time to the 50's for a moment. There were no word processors, and the photocopiers were used everywhere (kind of).
64+
65+
Imagine you are responsible for quickly issuing batches of letters as required, to be mailed to customers, using real paper and envelopes, to be delivered physically to each customer's address (there was no email back then).
66+
67+
At some point you realize the letters are just a composition of a large set of paragraphs, which are picked and arranged as needed, according to the purpose of the letter, so you devise a system to issue letters very quickly, expecting to get a hefty raise.
68+
69+
The system is really simple:
70+
71+
1. You begin with a deck of transparent sheets containing one paragraph each
72+
73+
2. To issue a set of letters, you pick the sheets with the paragraphs you need, then you stack and align them so they look and read fine and
74+
75+
3. Finally, you place the set in the photocopier and press start to produce as many letters as required.
76+
77+
So, simplifying, that's the core idea of Docker,
78+
79+
In Docker, each layer is the resulting set of changes that happen to the filesystem after executing a command, e.g. installing a program.
80+
81+
So, when you "look" at the filesystem after the layer has been copied, you see all the files, included the layer when the program was installed.
82+
83+
You can think of an image as an auxiliary read-only hard disk ready to be installed in a "computer" where the operating system is already installed.
84+
85+
Similary, you can think of a container as the "computer" with the image hard disk installed. The container, just like a computer, can be powered on or off.
5386

5487
>[!div class="step-by-step"]
5588
[Previous](index.md)

0 commit comments

Comments
 (0)