diff --git a/runnable-mail_test.go b/runnable-mail_test.go
index 65e814ed1fcd0fd5281d64cfe3cc0ebcdf7e3dc4..d7fb08ca321a70c552dbca9143591a4dfe0023aa 100644
--- a/runnable-mail_test.go
+++ b/runnable-mail_test.go
@@ -16,7 +16,7 @@ import (
 func startTestSMTPDockerImageAndContainer(t *testing.T, host string, port string, ctx context.Context) error {
 	t.Helper()
 
-	cli, err := client.NewClientWithOpts(client.WithVersion("1.41"))
+	cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
 	if err != nil {
 		return err
 	}
diff --git a/runnable-sftp_test.go b/runnable-sftp_test.go
index 4ab86c7bf7a555789aebee9c4bb5de7292efab89..d0ac05b5a2aae73386462c6d2576a062ddb3eb30 100644
--- a/runnable-sftp_test.go
+++ b/runnable-sftp_test.go
@@ -17,7 +17,7 @@ import (
 func startSFTPTestDockerImageAndContainer(t *testing.T, host string, port string, volume string, ctx context.Context) error {
 	t.Helper()
 
-	cli, err := client.NewClientWithOpts(client.WithVersion("1.41"))
+	cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
 	if err != nil {
 		return err
 	}
@@ -29,7 +29,7 @@ func startSFTPTestDockerImageAndContainer(t *testing.T, host string, port string
 		return err
 	}
 
-	// if debug image pull, comment out the following lines
+	//if debug image pull, comment out the following lines
 	//_, _ = io.Copy(os.Stdout, reader)
 	_ = reader