Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions content/language/dotnet/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,10 @@ cb36e310aa7e docker-dotnet-server "dotnet myWebApp.dll" About a minute ag
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 start a bash shell in the postgres 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.

```console
$ docker exec -it 39fdcf0aff7b bash
```

Then run the following command to connect to the database.

```console
postgres@39fdcf0aff7b:/$ psql -d example -U postgres
$ docker exec -it 39fdcf0aff7b psql -d example -U postgres
```

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

Close the database connection and exit the container shell by running `exit` twice.
Close the database connection and exit the container shell by running `exit`.

```console
example=# exit
postgres@39fdcf0aff7b:/$ exit
```

## Verify that data persists in the database
Expand Down