Skip to content

Commit 153df0e

Browse files
authored
chore: Cleanup devlang for code blocks (#20609)
* chore: Cleanup devlang for code blocks Automated cleanup from docs authoring pack * fix: "docker" devlang to "console" * fix: "docker" devlang to "dockerfile
1 parent d272247 commit 153df0e

File tree

20 files changed

+68
-68
lines changed

20 files changed

+68
-68
lines changed

docs/architecture/cloud-native/feature-flags.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Feature flags also promote `trunk-based` development. It's a source-control bran
2424

2525
At its core, a feature flag is a reference to a simple `decision object`. It returns a Boolean state of `on` or `off`. The flag typically wraps a block of code that encapsulates a feature capability. The state of the flag determines whether that code block executes for a given user. Figure 10-11 shows the implementation.
2626

27-
```c#
27+
```csharp
2828
if (featureFlag) {
2929
// Run this code block if the featureFlag value is true
3030
} else {
@@ -44,15 +44,15 @@ Feature flags can be easily implemented in an [ASP.NET Core service](https://doc
4444

4545
Once configured in your Startup class, you can add feature flag functionality at the controller, action, or middleware level. Figure 10-12 presents controller and action implementation:
4646

47-
```c#
47+
```csharp
4848
[FeatureGate(MyFeatureFlags.FeatureA)]
4949
public class ProductController : Controller
5050
{
5151
...
5252
}
5353
```
5454

55-
```c#
55+
```csharp
5656
[FeatureGate(MyFeatureFlags.FeatureA)]
5757
public IActionResult UpdateProductStatus()
5858
{
@@ -66,7 +66,7 @@ If a feature flag is disabled, the user will receive a 404 (Not Found) status co
6666

6767
Feature flags can also be injected directly into C# classes. Figure 10-13 shows feature flag injection:
6868

69-
```c#
69+
```csharp
7070
public class ProductController : Controller
7171
{
7272
private readonly IFeatureManager _featureManager;

docs/architecture/cloud-native/leverage-containers-orchestrators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Visual Studio supports Docker development for web-based applications. When you c
178178

179179
When this option is selected, the project is created with a `Dockerfile` in its root, which can be used to build and host the app in a Docker container. An example Dockerfile is shown in Figure 3-6.git
180180

181-
```docker
181+
```dockerfile
182182
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
183183
WORKDIR /app
184184
EXPOSE 80

docs/architecture/containerized-lifecycle/design-develop-containerized-apps/docker-apps-inner-loop-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Using an official repository of a language stack with a version number ensures t
113113

114114
The following is a sample DockerFile for a .NET Core container:
115115

116-
```Dockerfile
116+
```dockerfile
117117
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
118118
WORKDIR /app
119119
EXPOSE 80

docs/architecture/containerized-lifecycle/design-develop-containerized-apps/set-up-windows-containers-with-powershell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ With [Windows Containers](/virtualization/windowscontainers/about/index), you ca
99

1010
To use Windows Containers, you just need to write Windows PowerShell commands in the DockerFile, as demonstrated in the following example:
1111

12-
```Dockerfile
12+
```dockerfile
1313
FROM microsoft/windowsservercore
1414
LABEL Description="IIS" Vendor="Microsoft" Version="10"
1515
RUN powershell -Command Add-WindowsFeature Web-Server
@@ -20,7 +20,7 @@ In this case, we're using Windows PowerShell to install a Windows Server Core ba
2020

2121
In a similar way, you also could use Windows PowerShell commands to set up additional components like the traditional ASP.NET 4.x and .NET 4.6 or any other Windows software, as shown here:
2222

23-
```Dockerfile
23+
```dockerfile
2424
RUN powershell add-windowsfeature web-asp-net45
2525
```
2626

docs/architecture/microservices/docker-application-development-process/docker-app-development-workflow.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Using an official .NET image repository from Docker Hub with a version number en
9797

9898
The following example shows a sample Dockerfile for an ASP.NET Core container.
9999

100-
```Dockerfile
100+
```dockerfile
101101
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
102102
ARG source
103103
WORKDIR /app
@@ -167,7 +167,7 @@ Probably the best way to understand multi-stage is going through a Dockerfile in
167167

168168
The initial Dockerfile might look something like this:
169169

170-
```Dockerfile
170+
```dockerfile
171171
1 FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
172172
2 WORKDIR /app
173173
3 EXPOSE 80
@@ -238,7 +238,7 @@ You'll take advantage of Docker's layer cache feature, which is quite simple: if
238238

239239
So, let's focus on the **build** stage, lines 5-6 are mostly the same, but lines 7-17 are different for every service from eShopOnContainers, so they have to execute every single time, however if you changed lines 7-16 to:
240240

241-
```Dockerfile
241+
```dockerfile
242242
COPY . .
243243
```
244244

@@ -250,7 +250,7 @@ Then it would be just the same for every service, it would copy the whole soluti
250250

251251
The next significant optimization involves the `restore` command executed in line 17, which is also different for every service of eShopOnContainers. If you change that line to just:
252252

253-
```Dockerfile
253+
```dockerfile
254254
RUN dotnet restore
255255
```
256256

@@ -270,7 +270,7 @@ For the final optimization, it just happens that line 20 is redundant, as line 2
270270

271271
The resulting file is then:
272272

273-
```Dockerfile
273+
```dockerfile
274274
1 FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
275275
2 WORKDIR /app
276276
3 EXPOSE 80
@@ -553,7 +553,7 @@ In addition, you need to perform step 2 (adding Docker support to your projects)
553553

554554
[Windows Containers](https://docs.microsoft.com/virtualization/windowscontainers/about/index) allow you to convert your existing Windows applications into Docker images and deploy them with the same tools as the rest of the Docker ecosystem. To use Windows Containers, you run PowerShell commands in the Dockerfile, as shown in the following example:
555555

556-
```Dockerfile
556+
```dockerfile
557557
FROM mcr.microsoft.com/windows/servercore
558558
LABEL Description="IIS" Vendor="Microsoft" Version="10"
559559
RUN powershell -Command Add-WindowsFeature Web-Server
@@ -562,7 +562,7 @@ CMD [ "ping", "localhost", "-t" ]
562562

563563
In this case, we are using a Windows Server Core base image (the FROM setting) and installing IIS with a PowerShell command (the RUN setting). In a similar way, you could also use PowerShell commands to set up additional components like ASP.NET 4.x, .NET 4.6, or any other Windows software. For example, the following command in a Dockerfile sets up ASP.NET 4.5:
564564

565-
```Dockerfile
565+
```dockerfile
566566
RUN powershell add-windowsfeature web-asp-net45
567567
```
568568

docs/architecture/microservices/multi-container-microservice-net-applications/database-server-container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static int Main(string[] args)
9595

9696
There's an important caveat when applying migrations and seeding a database during container startup. Since the database server might not be available for whatever reason, you must handle retries while waiting for the server to be available. This retry logic is handled by the `MigrateDbContext()` extension method, as shown in the following code:
9797

98-
```cs
98+
```csharp
9999
public static IWebHost MigrateDbContext<TContext>(
100100
this IWebHost host,
101101
Action<TContext,

docs/architecture/microservices/multi-container-microservice-net-applications/implement-api-gateways-with-ocelot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The HTTP request will end up running that kind of C# code accessing the microser
8282

8383
Regarding the microservice URL, when the containers are deployed in your local development PC (local Docker host), each microservice's container always has an internal port (usually port 80) specified in its dockerfile, as in the following dockerfile:
8484

85-
```Dockerfile
85+
```dockerfile
8686
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
8787
WORKDIR /app
8888
EXPOSE 80

docs/architecture/microservices/multi-container-microservice-net-applications/multi-container-applications-docker-compose.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ The values set in the run-time environment always override the values defined in
431431

432432
If you are exploring Docker and .NET Core on sources on the Internet, you will find Dockerfiles that demonstrate the simplicity of building a Docker image by copying your source into a container. These examples suggest that by using a simple configuration, you can have a Docker image with the environment packaged with your application. The following example shows a simple Dockerfile in this vein.
433433

434-
```Dockerfile
434+
```dockerfile
435435
FROM mcr.microsoft.com/dotnet/core/sdk:3.1
436436
WORKDIR /app
437437
ENV ASPNETCORE_URLS http://+:80

docs/architecture/modern-web-apps-azure/common-web-application-architectures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ networks:
261261
262262
The `docker-compose.yml` file references the `Dockerfile` in the `Web` project. The `Dockerfile` is used to specify which base container will be used and how the application will be configured on it. The `Web`' `Dockerfile`:
263263

264-
```Dockerfile
264+
```dockerfile
265265
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
266266
WORKDIR /app
267267

docs/architecture/modern-web-apps-azure/test-asp-net-core-mvc-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ namespace Microsoft.eShopWeb.FunctionalTests.Web
252252

253253
Tests can make use of this custom WebApplicationFactory by using it to create a client and then making requests to the application using this client instance. The application will have data seeded that can be used as part of the test's assertions. The following test verifies that the home page of the eShopOnWeb application loads correctly and includes a product listing that was added to the application as part of the seed data.
254254

255-
```cs
255+
```csharp
256256
using Microsoft.eShopWeb.FunctionalTests.Web;
257257
using System.Net.Http;
258258
using System.Threading.Tasks;

docs/core/docker/build-container.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ docker-working
209209

210210
From your terminal, run the following command:
211211

212-
```Docker
212+
```console
213213
docker build -t counter-image -f Dockerfile .
214214
```
215215

216216
Docker will process each line in the *Dockerfile*. The `.` in the `docker build` command tells Docker to use the current folder to find a *Dockerfile*. This command builds the image and creates a local repository named **counter-image** that points to that image. After this command finishes, run `docker images` to see a list of images installed:
217217

218-
```Docker
218+
```console
219219
docker images
220220
REPOSITORY TAG IMAGE ID CREATED SIZE
221221
counter-image latest e6780479db63 4 days ago 190MB
@@ -238,7 +238,7 @@ The next command, `ENTRYPOINT`, tells Docker to configure the container to run a
238238

239239
From your terminal, run `docker build -t counter-image -f Dockerfile .` and when that command finishes, run `docker images`.
240240

241-
```Docker
241+
```console
242242
docker build -t counter-image -f Dockerfile .
243243
Sending build context to Docker daemon 1.117MB
244244
Step 1/4 : FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
@@ -268,14 +268,14 @@ Each command in the *Dockerfile* generated a layer and created an **IMAGE ID**.
268268

269269
Now that you have an image that contains your app, you can create a container. You can create a container in two ways. First, create a new container that is stopped.
270270

271-
```Docker
271+
```console
272272
docker create --name core-counter counter-image
273273
0f281cb3af994fba5d962cc7d482828484ea14ead6bfe386a35e5088c0058851
274274
```
275275

276276
The `docker create` command from above will create a container based on the **counter-image** image. The output of that command shows you the **CONTAINER ID** (yours will be different) of the created container. To see a list of *all* containers, use the `docker ps -a` command:
277277

278-
```Docker
278+
```console
279279
docker ps -a
280280
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
281281
0f281cb3af99 counter-image "dotnet NetCore.Dock…" 40 seconds ago Created core-counter
@@ -285,7 +285,7 @@ CONTAINER ID IMAGE COMMAND CREATED STA
285285

286286
The container was created with a specific name `core-counter`, this name is used to manage the container. The following example uses the `docker start` command to start the container, and then uses the `docker ps` command to only show containers that are running:
287287

288-
```Docker
288+
```console
289289
docker start core-counter
290290
core-counter
291291

@@ -296,7 +296,7 @@ CONTAINER ID IMAGE COMMAND CREATED STAT
296296

297297
Similarly, the `docker stop` command will stop the container. The following example uses the `docker stop` command to stop the container, and then uses the `docker ps` command to show that no containers are running:
298298

299-
```Docker
299+
```console
300300
docker stop core-counter
301301
core-counter
302302

@@ -310,7 +310,7 @@ After a container is running, you can connect to it to see the output. Use the `
310310

311311
After you detach from the container, reattach to verify that it's still running and counting.
312312

313-
```Docker
313+
```console
314314
docker start core-counter
315315
core-counter
316316

@@ -331,13 +331,13 @@ Counter: 19
331331

332332
For the purposes of this article you don't want containers just hanging around doing nothing. Delete the container you previously created. If the container is running, stop it.
333333

334-
```Docker
334+
```console
335335
docker stop core-counter
336336
```
337337

338338
The following example lists all containers. It then uses the `docker rm` command to delete the container, and then checks a second time for any running containers.
339339

340-
```Docker
340+
```console
341341
docker ps -a
342342
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
343343
2f6424a7ddce counter-image "dotnet NetCore.Dock…" 7 minutes ago Exited (143) 20 seconds ago core-counter
@@ -353,7 +353,7 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
353353

354354
Docker provides the `docker run` command to create and run the container as a single command. This command eliminates the need to run `docker create` and then `docker start`. You can also set this command to automatically delete the container when the container stops. For example, use `docker run -it --rm` to do two things, first, automatically use the current terminal to connect to the container, and then when the container finishes, remove it:
355355

356-
```Docker
356+
```console
357357
docker run -it --rm counter-image
358358
Counter: 1
359359
Counter: 2
@@ -365,7 +365,7 @@ Counter: 5
365365

366366
The container also passes parameters into the execution of the .NET Core app. To instruct the .NET Core app to count only to 3 pass in 3.
367367

368-
```Docker
368+
```console
369369
docker run -it --rm counter-image 3
370370
Counter: 1
371371
Counter: 2
@@ -374,7 +374,7 @@ Counter: 3
374374

375375
With `docker run -it`, the <kbd>Ctrl+C</kbd> command will stop process that is running in the container, which in turn, stops the container. Since the `--rm` parameter was provided, the container is automatically deleted when the process is stopped. Verify that it doesn't exist:
376376

377-
```Docker
377+
```console
378378
docker ps -a
379379
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
380380
```
@@ -387,7 +387,7 @@ The `docker run` command also lets you modify the `ENTRYPOINT` command from the
387387

388388
In this example, `ENTRYPOINT` is changed to `cmd.exe`. <kbd>Ctrl+C</kbd> is pressed to end the process and stop the container.
389389

390-
```Docker
390+
```console
391391
docker run -it --rm --entrypoint "cmd.exe" counter-image
392392

393393
Microsoft Windows [Version 10.0.17763.379]
@@ -446,25 +446,25 @@ During this tutorial, you created containers and images. If you want, delete the
446446

447447
01. List all containers
448448

449-
```Docker
449+
```console
450450
docker ps -a
451451
```
452452

453453
02. Stop containers that are running by their name.
454454

455-
```Docker
455+
```console
456456
docker stop counter-image
457457
```
458458

459459
03. Delete the container
460460

461-
```Docker
461+
```console
462462
docker rm counter-image
463463
```
464464

465465
Next, delete any images that you no longer want on your machine. Delete the image created by your *Dockerfile* and then delete the .NET Core image the *Dockerfile* was based on. You can use the **IMAGE ID** or the **REPOSITORY:TAG** formatted string.
466466

467-
```Docker
467+
```console
468468
docker rmi counter-image:latest
469469
docker rmi mcr.microsoft.com/dotnet/core/aspnet:3.1
470470
```

docs/core/tutorials/netcore-hosting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ In this sample, the host can now call `managedDelegate` to run the `ManagedWorke
143143

144144
Alternatively, the `coreclr_execute_assembly` function can be used to launch a managed executable. This API takes an assembly path and array of arguments as input parameters. It loads the assembly at that path and invokes its main method.
145145

146-
```C++
146+
```c++
147147
int hr = executeAssembly(
148148
hostHandle,
149149
domainId,
@@ -196,7 +196,7 @@ With an `ICLRRuntimeHost4` in-hand, we can now specify runtime-wide startup flag
196196

197197
The runtime is started with a call to the `Start` function.
198198

199-
```C++
199+
```c++
200200
hr = runtimeHost->Start();
201201
```
202202

@@ -238,7 +238,7 @@ With an AppDomain up and running, the host can now start executing managed code.
238238

239239
Another option, if `ExecuteAssembly` doesn't meet your host's needs, is to use `CreateDelegate` to create a function pointer to a static managed method. This requires the host to know the signature of the method it is calling into (in order to create the function pointer type) but allows hosts the flexibility to invoke code other than an assembly's entry point. The assembly name provided in the second parameter is the [full managed assembly name](../../standard/assembly/names.md) of the library to load.
240240

241-
```C++
241+
```c++
242242
void *pfnDelegate = NULL;
243243
hr = runtimeHost->CreateDelegate(
244244
domainId,

0 commit comments

Comments
 (0)