mirror of https://github.com/docker/docs.git
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 <craig.osterhout@docker.com>
This commit is contained in:
parent
ae785fef86
commit
592b28729b
|
@ -64,7 +64,7 @@ spec:
|
||||||
name: server
|
name: server
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 8080
|
||||||
hostPort: 8080
|
hostPort: 8080
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
resources: {}
|
resources: {}
|
||||||
|
@ -117,7 +117,7 @@ spec:
|
||||||
ports:
|
ports:
|
||||||
- name: "8080"
|
- name: "8080"
|
||||||
port: 8080
|
port: 8080
|
||||||
targetPort: 80
|
targetPort: 8080
|
||||||
nodePort: 30001
|
nodePort: 30001
|
||||||
selector:
|
selector:
|
||||||
service: server
|
service: server
|
||||||
|
|
|
@ -182,9 +182,9 @@ $ docker container ls
|
||||||
You should see output like the following.
|
You should see output like the following.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||||
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
|
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
|
||||||
39fdcf0aff7b postgres "docker-entrypoint.s…" About a minute ago Up About a minute (healthy) 5432/tcp docker-dotnet-db-1
|
39fdcf0aff7b postgres "docker-entrypoint.s…" About a minute ago Up About a minute (healthy) 5432/tcp docker-dotnet-db-1
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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:
|
||||||
context: .
|
context: .
|
||||||
target: final
|
target: final
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 8080:8080
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
@ -337,14 +337,14 @@ ENTRYPOINT ["dotnet", "myWebApp.dll"]
|
||||||
|
|
||||||
The following is the updated `compose.yaml` file.
|
The following is the updated `compose.yaml` file.
|
||||||
|
|
||||||
```yaml {hl_lines="5"}
|
```yaml {hl_lines=[5,15,16]}
|
||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
target: development
|
target: development
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 8080:8080
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
@ -354,7 +354,6 @@ services:
|
||||||
path: .
|
path: .
|
||||||
environment:
|
environment:
|
||||||
- ASPNETCORE_ENVIRONMENT=Development
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
- ASPNETCORE_URLS=http://+:80'
|
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres
|
||||||
restart: always
|
restart: always
|
||||||
|
|
Loading…
Reference in New Issue