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;

0 commit comments

Comments
 (0)