title: Testcontainers: docker-machine executable was not found on PATH
body: <p>I have two spring boot projects both with the same JDK and running on the same machine (apple m1). The first project is just a dummy project with just testcontainer dependency in it.</p>
  <p>While the second project is a legacy project in which i was supposed to integrate testcontainer.</p>
  <p>But while testcontainer is running in the first project, for second project I am getting the below error (i have just copy-pasted testcontainer code from the first project)</p>
  <p>JDK:azul 15.0.5</p>
  <p>JAVA path: Library/Java/JavaVirtualMachines/azul-15.0.5/Contents/Home/bin/java
  Docker Desktop Version: 4.5.0</p>
  <p>How to resolve this error?</p>
  <pre><code>17:15:41.181 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
  17:15:41.189 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
  17:15:41.211 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [com.housing.cron.ListingUpdateBatchContainerTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
  17:15:41.218 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.housing.cron.ListingUpdateBatchContainerTest], using SpringBootContextLoader
  17:15:41.221 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.housing.cron.ListingUpdateBatchContainerTest]: class path resource [com/housing/cron/ListingUpdateBatchContainerTest-context.xml] does not exist
  17:15:41.222 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.housing.cron.ListingUpdateBatchContainerTest]: class path resource [com/housing/cron/ListingUpdateBatchContainerTestContext.groovy] does not exist
  17:15:41.222 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [com.housing.cron.ListingUpdateBatchContainerTest]: no resource found for suffixes {-context.xml, Context.groovy}.
  17:15:41.222 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.housing.cron.ListingUpdateBatchContainerTest]: ListingUpdateBatchContainerTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
  17:15:41.254 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.housing.cron.ListingUpdateBatchContainerTest]
  17:15:41.292 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [/Users/pankajkumar/Desktop/workspace/services/jasprr/cron/target/classes/com/housing/cron/CronApplication.class]
  17:15:41.293 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration com.housing.cron.CronApplication for test class com.housing.cron.ListingUpdateBatchContainerTest
  17:15:41.360 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [com.housing.cron.ListingUpdateBatchContainerTest]: using defaults.
  17:15:41.360 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener]
  17:15:41.372 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@3f1c5af9, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@1c55f277, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@5ddabb18, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@3e8f7922, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@63192798, org.springframework.test.context.support.DirtiesContextTestExecutionListener@50eca7c6, org.springframework.test.context.transaction.TransactionalTestExecutionListener@58e6d4b8, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@1de5f0ef, org.springframework.test.context.event.EventPublishingTestExecutionListener@376a312c, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@28d6290, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@6ca0256d, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@5ef0d29e, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@38f57b3d, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@51850751, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@3ce3db41]
  17:15:41.374 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@1d7f7be7 testClass = ListingUpdateBatchContainerTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@42f3156d testClass = ListingUpdateBatchContainerTest, locations = '{}', classes = '{class com.housing.cron.CronApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.test.context.support.DynamicPropertiesContextCustomizer@46eedc3b, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@6c2ed0cd, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@51133c06, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@5a3bc7ed, org.springframework.boot.test.web.reactive.server.WebTestClientContextCustomizer@4671115f, org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@46b61c56, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@68df9280, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@f2f2cc1], contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map[[empty]]], class annotated with @DirtiesContext [false] with mode [null].
  17:15:41.421 [main] DEBUG org.testcontainers.utility.TestcontainersConfiguration - Testcontainers configuration overrides will be loaded from file:/Users/pankajkumar/.testcontainers.properties
  17:15:41.430 [main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy - Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
  17:15:41.430 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Trying out strategy: UnixSocketClientProviderStrategy
  17:15:41.575 [ducttape-0] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Pinging docker daemon...
  17:15:41.585 [ducttape-0] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: 
  17:15:41.595 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-00000001: preparing request execution
  17:15:41.597 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.protocol.RequestAddCookies - Cookie spec selected: strict
  17:15:41.598 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.protocol.RequestAuthCache - Auth cache not set in the context
  17:15:41.598 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-00000001: target auth state: UNCHALLENGED
  17:15:41.599 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-00000001: proxy auth state: UNCHALLENGED
  17:15:41.599 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ConnectExec - ex-00000001: acquiring connection with route {}-&gt;unix://localhost:2375
  17:15:41.599 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-00000001: acquiring endpoint (3 MINUTES)
  17:15:41.599 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-00000001: endpoint lease request (3 MINUTES) [route: {}-&gt;unix://localhost:2375][total available: 0; route allocated: 0 of 2147483647; total allocated: 0 of 2147483647]
  17:15:41.601 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-00000001: endpoint leased [route: {}-&gt;unix://localhost:2375][total available: 0; route allocated: 1 of 2147483647; total allocated: 1 of 2147483647]
  17:15:41.605 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-00000001: acquired ep-00000000
  17:15:41.605 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-00000001: acquired endpoint ep-00000000
  17:15:41.605 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ConnectExec - ex-00000001: opening connection {}-&gt;unix://localhost:2375
  17:15:41.605 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-00000000: connecting endpoint (3 MINUTES)
  17:15:41.606 [ducttape-0] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-00000000: connecting endpoint to unix://localhost:2375 (3 MINUTES)
  17:15:41.615 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - UnixSocketClientProviderStrategy: failed with exception RuntimeException (java.lang.UnsatisfiedLinkError: /private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp: dlopen(/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp, 0x0001): tried: '/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna11940079618175027996.tmp' (no such file)). Root cause UnsatisfiedLinkError (/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp: dlopen(/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp, 0x0001): tried: '/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna11940079618175027996.tmp' (no such file))
  17:15:41.617 [main] INFO org.testcontainers.dockerclient.DockerMachineClientProviderStrategy - docker-machine executable was not found on PATH ([/Users/pankajkumar/.rvm/gems/ruby-2.6.3/bin, /Users/pankajkumar/.rvm/gems/ruby-2.6.3@global/bin, /Users/pankajkumar/.rvm/rubies/ruby-2.6.3/bin, /Users/pankajkumar/.rbenv/shims, /opt/homebrew/bin, /opt/homebrew/sbin, /usr/local/bin, /usr/bin, /bin, /usr/sbin, /sbin, /Users/pankajkumar/.rvm/bin])
  17:15:41.617 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
  17:15:41.617 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy -     UnixSocketClientProviderStrategy: failed with exception RuntimeException (java.lang.UnsatisfiedLinkError: /private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp: dlopen(/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp, 0x0001): tried: '/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna11940079618175027996.tmp' (no such file)). Root cause UnsatisfiedLinkError (/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp: dlopen(/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp, 0x0001): tried: '/private/var/folders/fk/89nf61jd7dvb__ls49mj2q680000gp/T/jna--1700769283/jna11940079618175027996.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna11940079618175027996.tmp' (no such file))
  17:15:41.617 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - As no valid configuration was found, execution cannot continue
  17:15:41.618 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - After test class: context [DefaultTestContext@1d7f7be7 testClass = ListingUpdateBatchContainerTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@42f3156d testClass = ListingUpdateBatchContainerTest, locations = '{}', classes = '{class com.housing.cron.CronApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.test.context.support.DynamicPropertiesContextCustomizer@46eedc3b, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@6c2ed0cd, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@51133c06, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@5a3bc7ed, org.springframework.boot.test.web.reactive.server.WebTestClientContextCustomizer@4671115f, org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@46b61c56, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@68df9280, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@f2f2cc1], contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map[[empty]]], class annotated with @DirtiesContext [false] with mode [null].
  
  Test ignored.
  
  java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
  </code></pre>
  <p>First Project pom.xml</p>
  
  <p>
  4.0.0
  
  org.springframework.boot
  spring-boot-starter-parent
  2.5.3
   
  
  com.jetbrains
  testcontainers-demo
  0.0.1-SNAPSHOT
  testcontainers-demo
  Demo project for Spring Boot
  
  &lt;java.version&gt;11&lt;/java.version&gt;
  
  
  
  org.springframework.boot
  spring-boot-starter-web
  </p>
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- https://mvnrepository.com/artifact/org.postgresql/postgresql --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
          &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
          &lt;version&gt;42.3.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
          &lt;artifactId&gt;lombok&lt;/artifactId&gt;
          &lt;version&gt;1.18.22&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.testcontainers&lt;/groupId&gt;
          &lt;artifactId&gt;testcontainers&lt;/artifactId&gt;
          &lt;version&gt;1.16.3&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.testcontainers&lt;/groupId&gt;
          &lt;artifactId&gt;junit-jupiter&lt;/artifactId&gt;
          &lt;version&gt;1.16.3&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.testcontainers&lt;/groupId&gt;
          &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
          &lt;version&gt;1.16.3&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.aerospike&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-aerospike&lt;/artifactId&gt;
          &lt;version&gt;2.3.3.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
  
  
  &lt;/dependencies&gt;
  
  
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>