@@ -14,8 +14,6 @@ ms.assetid: 87e93838-a363-4813-b859-7356023d98ed
14
14
15
15
# Microservices hosted in Docker
16
16
17
- ## Introduction
18
-
19
17
This tutorial details the tasks necessary to build and deploy
20
18
an ASP.NET Core microservice in a Docker container. During the course
21
19
of this tutorial, you'll learn:
@@ -73,13 +71,13 @@ Grunt, and Gulp. If you have them installed that is good, otherwise type the fol
73
71
The ` -g ` option indicates that it is a global install, and those tools are
74
72
available system wide. (A local install scopes the package to a single
75
73
project). Once you've installed those core tools, you need to install
76
- the yeoman asp.net template generators:
74
+ the yeoman ASP.NET template generators:
77
75
78
76
` npm install -g generator-aspnet `
79
77
80
78
## Create the Application
81
79
82
- Now that you've installed all the tools, create a new asp.net core
80
+ Now that you've installed all the tools, create a new ASP.NET Core
83
81
application. To use the command line generator, execute the following
84
82
yeoman command in your favorite shell:
85
83
@@ -92,12 +90,12 @@ will prompt you for a name. Select 'WeatherMicroservice'.
92
90
93
91
The template creates eight files for you:
94
92
95
- * A .gitignore, customized for asp.net core applications.
93
+ * A .gitignore, customized for ASP.NET Core applications.
96
94
* A Startup.cs file. This contains the basis of the application.
97
95
* A Program.cs file. This contains the entry point of the application.
98
96
* A WeatherMicroservice.csproj file. This is the build file for the application.
99
97
* A Dockerfile. This script creates a Docker image for the application.
100
- * A README.md. This contains links to other asp.net core resources.
98
+ * A README.md. This contains links to other ASP.NET Core resources.
101
99
* A web.config file. This contains basic configuration information.
102
100
* A runtimeconfig.template.json file. This contains debugging settings used by IDEs.
103
101
@@ -148,7 +146,7 @@ framework that will run this application.
148
146
The application is implemented in Startup.cs. This file contains the startup
149
147
class.
150
148
151
- The two methods are called by the asp.net core infrastructure to configure
149
+ The two methods are called by the ASP.NET Core infrastructure to configure
152
150
and run the application. The ` ConfigureServices ` method describes the services that are
153
151
necessary for this application. You're building a lean microservice, so it doesn't
154
152
need to configure any dependencies. The ` Configure ` method configures the handlers
@@ -309,7 +307,7 @@ A ***Docker Container*** represents a running instance of a Docker image.
309
307
By analogy, you can think of the * Docker Image* as a * class* , and the
310
308
* Docker Container* as an object, or an instance of that class.
311
309
312
- The Dockerfile created by the asp.net template will serve
310
+ The Dockerfile created by the ASP.NET template will serve
313
311
for our purposes. Let's go over its contents.
314
312
315
313
The first line specifies the source image:
@@ -349,7 +347,7 @@ RUN dotnet publish -c Release -o out
349
347
350
348
[ !INCLUDE[ DotNet Restore Note] ( ~/includes/dotnet-restore-note.md )]
351
349
352
- This will copy the project file from the current directory to the docker VM, and restore
350
+ This will copy the project file from the current directory to the Docker VM, and restore
353
351
all the packages. Using the dotnet CLI means that the Docker image must include the
354
352
.NET Core SDK. After that, the rest of your application gets copied, and the dotnet
355
353
publish command builds and packages your application.
@@ -362,7 +360,7 @@ ENTRYPOINT ["dotnet", "out/WeatherMicroservice.dll", "--server.urls", "http://0.
362
360
363
361
This configured port is referenced in the ` --server.urls `
364
362
argument to ` dotnet ` on the last line of the Dockerfile. The ` ENTRYPOINT ` command
365
- informs Docker what command and command line options start the service.
363
+ informs Docker what command and command- line options start the service.
366
364
367
365
## Building and running the image in a container.
368
366
@@ -380,7 +378,7 @@ out/*
380
378
```
381
379
382
380
You build the image
383
- using the docker build command. Run the following command from the directory containing your code.
381
+ using the ` docker build ` command. Run the following command from the directory containing your code.
384
382
385
383
``` console
386
384
docker build -t weather-microservice .
@@ -438,7 +436,7 @@ container process, but rather stop the `docker attach` command. The final argume
438
436
is the name given to the container in the ` docker run ` command.
439
437
440
438
> [ !NOTE]
441
- > You can also use the docker assigned container ID to refer to any container. If you
439
+ > You can also use the Docker assigned container ID to refer to any container. If you
442
440
> didn't specify a name for your container in ` docker run ` you must use the container id.
443
441
444
442
Open a browser and navigate to your service. You'll see the diagnostic messages in
@@ -467,10 +465,10 @@ docker rmi weather-microservice
467
465
468
466
## Conclusion
469
467
470
- In this tutorial, you built an asp.net core microservice, and added a few
468
+ In this tutorial, you built an ASP.NET Core microservice, and added a few
471
469
simple features.
472
470
473
- You built a docker container image for that service, and ran that container on
471
+ You built a Docker container image for that service, and ran that container on
474
472
your machine. You attached a terminal window to the service, and saw the
475
473
diagnostic messages from your service.
476
474
0 commit comments