@@ -99,7 +99,7 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
9999 envVar = localstackHostEnvVar
100100 }
101101
102- hostnameExternalReason , err := configureDockerHost (& localStackReq , envVar )
102+ hostnameExternalReason , err := configureDockerHost (& localStackReq , envVar , opts ... )
103103 if err != nil {
104104 return nil , err
105105 }
@@ -125,7 +125,7 @@ func StartContainer(ctx context.Context, overrideReq OverrideContainerRequestOpt
125125 return RunContainer (ctx , overrideReq )
126126}
127127
128- func configureDockerHost (req * LocalStackContainerRequest , envVar string ) (string , error ) {
128+ func configureDockerHost (req * LocalStackContainerRequest , envVar string , opts ... testcontainers. ContainerCustomizer ) (string , error ) {
129129 reason := ""
130130
131131 if _ , ok := req .Env [envVar ]; ok {
@@ -141,13 +141,7 @@ func configureDockerHost(req *LocalStackContainerRequest, envVar string) (string
141141 return "to match last network alias on container with non-default network" , nil
142142 }
143143
144- dockerProvider , err := testcontainers .NewDockerProvider ()
145- if err != nil {
146- return reason , err
147- }
148- defer dockerProvider .Close ()
149-
150- daemonHost , err := dockerProvider .DaemonHost (context .Background ())
144+ daemonHost , err := testcontainers .ContainerHost (context .Background (), opts ... )
151145 if err != nil {
152146 return reason , err
153147 }
0 commit comments