From 799ee150afa508ce4b9f6e517ac457ecf8176d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 5 Sep 2024 10:51:18 +0200 Subject: [PATCH] docs: do not use postgres in funcitonal options --- docs/features/common_functional_options.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/features/common_functional_options.md b/docs/features/common_functional_options.md index 88beba1756..8db0e7e1ee 100644 --- a/docs/features/common_functional_options.md +++ b/docs/features/common_functional_options.md @@ -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. @@ -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. } @@ -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. @@ -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{