Skip to content

Commit

Permalink
docs: do not use postgres in funcitonal options
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Sep 5, 2024
1 parent dd91901 commit 799ee15
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/features/common_functional_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ postgres, err = postgresModule.Run(ctx, "postgres:15-alpine", testcontainers.Wit
If you need to access a port that is already running in the host, you can use `testcontainers.WithHostPortAccess` for example:

```golang
postgres, err = postgresModule.Run(ctx, "postgres:15-alpine", testcontainers.WithHostPortAccess(8080))
ctr, err = tcmodule.Run(ctx, "your-image:your-tag", testcontainers.WithHostPortAccess(8080))
```

To understand more about this feature, please read the [Exposing host ports to the container](/features/networking/#exposing-host-ports-to-the-container) documentation.
Expand Down Expand Up @@ -70,7 +70,7 @@ useful context instead of appearing out of band.
```golang
func TestHandler(t *testing.T) {
logger := TestLogger(t)
_, err := postgresModule.Run(ctx, "postgres:15-alpine", testcontainers.WithLogger(logger))
_, err := postgresModule.Run(ctx, "your-image:your-tag", testcontainers.WithLogger(logger))
require.NoError(t, err)
// Do something with container.
}
Expand Down Expand Up @@ -142,7 +142,7 @@ In the case you need to retrieve the network name, you can use the `Networks(ctx
If you want to reuse a container across different test executions, you can use `testcontainers.WithReuse` option. This option will keep the container running after the test execution, so it can be reused by any other test sharing the same `ContainerRequest`. As a result, the container is not terminated by Ryuk.

```golang
postgres, err = postgresModule.Run(ctx, "postgres:15-alpine", testcontainers.WithReuse())
ctr, err = tcmodule.Run(ctx, "your-image:your-tag", testcontainers.WithReuse())
```

Please read the [Reuse containers](/features/creating_container#reusable-container) documentation for more information.
Expand All @@ -162,7 +162,7 @@ Please read the [Create containers: Advanced Settings](/features/creating_contai
This option will merge the customized request into the module's own `ContainerRequest`.

```go
container, err := Run(ctx, "postgres:13-alpine",
ctr, err := Run(ctx, "your-image:your-tag",
/* Other module options */
testcontainers.CustomizeRequest(testcontainers.GenericContainerRequest{
ContainerRequest: testcontainers.ContainerRequest{
Expand Down

0 comments on commit 799ee15

Please sign in to comment.