Skip to content

Commit 34bc2ff

Browse files
author
JP Bulman
authored
Update Dotnet Containerization Docs (#19867)
* Update Dotnet Containerization Docs This is a condensed version of the two separate commands to connect to the docker container and to log into postgres. * Update exit commands
1 parent 685cb30 commit 34bc2ff

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

content/language/dotnet/develop.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,10 @@ cb36e310aa7e docker-dotnet-server "dotnet myWebApp.dll" About a minute ag
182182
39fdcf0aff7b postgres "docker-entrypoint.s…" About a minute ago Up About a minute (healthy) 5432/tcp docker-dotnet-db-1
183183
```
184184

185-
In the previous example, the container ID is `39fdcf0aff7b`. Run the following command to start a bash shell in the postgres container. Replace the container ID with your own container ID.
185+
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.
186186

187187
```console
188-
$ docker exec -it 39fdcf0aff7b bash
189-
```
190-
191-
Then run the following command to connect to the database.
192-
193-
```console
194-
postgres@39fdcf0aff7b:/$ psql -d example -U postgres
188+
$ docker exec -it 39fdcf0aff7b psql -d example -U postgres
195189
```
196190

197191
And finally, insert a record into the database.
@@ -206,11 +200,10 @@ You should see output like the following.
206200
INSERT 0 1
207201
```
208202

209-
Close the database connection and exit the container shell by running `exit` twice.
203+
Close the database connection and exit the container shell by running `exit`.
210204

211205
```console
212206
example=# exit
213-
postgres@39fdcf0aff7b:/$ exit
214207
```
215208

216209
## Verify that data persists in the database

0 commit comments

Comments
 (0)