You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/standard/microservices-architecture/container-docker-introduction/docker-containers-images-registries.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,19 @@ title: Docker containers, images, and registries
3
3
description: .NET Microservices Architecture for Containerized .NET Applications | Docker containers, images, and registries
4
4
author: CESARDELATORRE
5
5
ms.author: wiwagn
6
-
ms.date: 05/26/2017
6
+
ms.date: 08/31/2018
7
7
---
8
8
# Docker containers, images, and registries
9
9
10
10
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.
11
11
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.
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.
13
13
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.
15
15
16
16
Figure 2-4 shows how images and registries in Docker relate to other components. It also shows the multiple registry offerings from vendors.
17
17
18
-

18
+

19
19
20
20
**Figure 2-4**. Taxonomy of Docker terms and concepts
21
21
@@ -25,7 +25,7 @@ Private image registries, either hosted on-premises or in the cloud, are recomme
25
25
26
26
- Your images must not be shared publicly due to confidentiality.
27
27
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.
Copy file name to clipboardExpand all lines: docs/standard/microservices-architecture/container-docker-introduction/docker-defined.md
+52-19Lines changed: 52 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,53 +3,86 @@ title: What is Docker?
3
3
description: .NET Microservices Architecture for Containerized .NET Applications | What is Docker?
4
4
author: CESARDELATORRE
5
5
ms.author: wiwagn
6
-
ms.date: 05/26/2017
6
+
ms.date: 08/31/2018
7
7
---
8
8
# What is Docker?
9
9
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.
11
11
12
-

12
+

13
13
14
14
**Figure 2-2**. Docker deploys containers at all layers of the hybrid cloud
15
15
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.
17
17
18
-
You can develop on Windows, Linux, or macOS. The development computerruns 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.
19
19
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.
21
21
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:
23
23
24
24
- 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.
25
25
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.
27
27
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).
29
29
30
30
## Comparing Docker containers with virtual machines
31
31
32
32
Figure 2-3 shows a comparison between VMs and Docker containers.
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.
<p><imgsrc="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>
<p><imgsrc="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>
41
46
42
47
**Figure 2-3**. Comparison of traditional virtual machines to Docker containers
43
48
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.
45
50
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.
47
52
48
53
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.
49
54
50
55
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.
51
56
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.
0 commit comments