Skip to content

Commit 592b287

Browse files
guides: fix port in .net guide (#22269)
<!--Delete sections as needed --> ## Description The default port changed from 80 to 8080 when we switched to a newer version of .net in #21877. https://learn.microsoft.com/en-us/dotnet/core/compatibility/containers/8.0/aspnet-port https://deploy-preview-22269--docsdocker.netlify.app/guides/dotnet/develop/ https://deploy-preview-22269--docsdocker.netlify.app/guides/dotnet/deploy/ ## Related issues or tickets Closes #22265 Related to #22080 ENGDOCS-2492 ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review --------- Signed-off-by: Craig <[email protected]>
1 parent ae785fe commit 592b287

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

content/guides/dotnet/deploy.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ spec:
6464
name: server
6565
imagePullPolicy: Always
6666
ports:
67-
- containerPort: 80
67+
- containerPort: 8080
6868
hostPort: 8080
6969
protocol: TCP
7070
resources: {}
@@ -117,7 +117,7 @@ spec:
117117
ports:
118118
- name: "8080"
119119
port: 8080
120-
targetPort: 80
120+
targetPort: 8080
121121
nodePort: 30001
122122
selector:
123123
service: server

content/guides/dotnet/develop.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ $ docker container ls
182182
You should see output like the following.
183183

184184
```console
185-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
186-
cb36e310aa7e docker-dotnet-server "dotnet myWebApp.dll" About a minute ago Up About a minute 0.0.0.0:8080->80/tcp docker-dotnet-server-1
187-
39fdcf0aff7b postgres "docker-entrypoint.s…" About a minute ago Up About a minute (healthy) 5432/tcp docker-dotnet-db-1
185+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
186+
cb36e310aa7e docker-dotnet-server "dotnet myWebApp.dll" About a minute ago Up About a minute 0.0.0.0:8080->8080/tcp docker-dotnet-server-1
187+
39fdcf0aff7b postgres "docker-entrypoint.s…" About a minute ago Up About a minute (healthy) 5432/tcp docker-dotnet-db-1
188188
```
189189

190190
In the previous example, the container ID is `39fdcf0aff7b`. Run the following command to connect to the postgres database in the container. Replace the container ID with your own container ID.
@@ -241,7 +241,7 @@ services:
241241
context: .
242242
target: final
243243
ports:
244-
- 8080:80
244+
- 8080:8080
245245
depends_on:
246246
db:
247247
condition: service_healthy
@@ -337,14 +337,14 @@ ENTRYPOINT ["dotnet", "myWebApp.dll"]
337337

338338
The following is the updated `compose.yaml` file.
339339

340-
```yaml {hl_lines="5"}
340+
```yaml {hl_lines=[5,15,16]}
341341
services:
342342
server:
343343
build:
344344
context: .
345345
target: development
346346
ports:
347-
- 8080:80
347+
- 8080:8080
348348
depends_on:
349349
db:
350350
condition: service_healthy
@@ -354,7 +354,6 @@ services:
354354
path: .
355355
environment:
356356
- ASPNETCORE_ENVIRONMENT=Development
357-
- ASPNETCORE_URLS=http://+:80'
358357
db:
359358
image: postgres
360359
restart: always

0 commit comments

Comments
 (0)