From 738e8fc456c4a2736a6499daef0a0c0a68ac628f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 23 Sep 2024 12:28:03 +0200 Subject: [PATCH] chore: use a much smaller image for testing (#2795) --- wait/exec_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/wait/exec_test.go b/wait/exec_test.go index 224f7d99d9..8a82fb0211 100644 --- a/wait/exec_test.go +++ b/wait/exec_test.go @@ -22,16 +22,17 @@ import ( func ExampleExecStrategy() { ctx := context.Background() req := testcontainers.ContainerRequest{ - Image: "localstack/localstack:latest", - WaitingFor: wait.ForExec([]string{"awslocal", "dynamodb", "list-tables"}), + Image: "alpine:latest", + Entrypoint: []string{"tail", "-f", "/dev/null"}, // needed for the container to stay alive + WaitingFor: wait.ForExec([]string{"ls", "/"}).WithStartupTimeout(1 * time.Second), } - localstack, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ + ctr, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: req, Started: true, }) defer func() { - if err := testcontainers.TerminateContainer(localstack); err != nil { + if err := testcontainers.TerminateContainer(ctr); err != nil { log.Printf("failed to terminate container: %s", err) } }() @@ -40,7 +41,7 @@ func ExampleExecStrategy() { return } - state, err := localstack.State(ctx) + state, err := ctr.State(ctx) if err != nil { log.Printf("failed to get container state: %s", err) return