Skip to content

Commit fa51914

Browse files
committed
fix: do not use deprecated APIs
1 parent 3b99c05 commit fa51914

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/localstack/localstack.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"golang.org/x/mod/semver"
1010

11+
"github.com/docker/docker/api/types/container"
1112
"github.com/testcontainers/testcontainers-go"
1213
"github.com/testcontainers/testcontainers-go/internal/testcontainersdocker"
1314
"github.com/testcontainers/testcontainers-go/wait"
@@ -92,10 +93,12 @@ func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomize
9293

9394
req := testcontainers.ContainerRequest{
9495
Image: fmt.Sprintf("localstack/localstack:%s", defaultVersion),
95-
Binds: []string{fmt.Sprintf("%s:/var/run/docker.sock", dockerHost)},
9696
WaitingFor: wait.ForHTTP("/_localstack/health").WithPort("4566/tcp").WithStartupTimeout(120 * time.Second),
9797
ExposedPorts: []string{fmt.Sprintf("%d/tcp", defaultPort)},
9898
Env: map[string]string{},
99+
HostConfigModifier: func(hostConfig *container.HostConfig) {
100+
hostConfig.Binds = []string{fmt.Sprintf("%s:/var/run/docker.sock", dockerHost)}
101+
},
99102
}
100103

101104
localStackReq := LocalStackContainerRequest{

0 commit comments

Comments
 (0)