Platform argument required for docker run
On a new MacBook with the M1 chip, I get an error when trying to start a container:
no suitable image found. Did find:
/some/random/tmp/file: no matching architecture in universal wrapper
I get a similar error running the container manually with docker run <image-name>, but it will work if I use docker run --platform linux/amd64 <image-name>. Is it possible to use that parameter with testcontainters?
I have the same problem with a MacBook Pro Silicon M1 chip. I want to run a PostgreSQL container that has an ARM version indeed:

I can perfectly run by terminal:

However, I got an exception when I run the test in IntelliJ or by commands (I remark this to dismiss the idea that can be an IDE problem). I test this code on my old PC with an x86-64 processor and it runs fine, the code is:
package de.rieckpil.blog;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.testcontainers.containers.PostgreSQLContainer;
@RunWith(SpringRunner.class)
@SpringBootTest
@ContextConfiguration(initializers = SpringBootHibernateFlywayBestPracticesApplicationTests.Initializer.class)
public class SpringBootHibernateFlywayBestPracticesApplicationTests {
@ClassRule
public static PostgreSQLContainer postgreSQLContainer = new PostgreSQLContainer("postgres:latest")
.withDatabaseName("postgres")
.withPassword("postgres")
.withUsername("username")
;
static class Initializer
implements ApplicationContextInitializer<ConfigurableApplicationContext> {
public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
TestPropertyValues.of(
"spring.datasource.url=" + postgreSQLContainer.getJdbcUrl(),
"spring.datasource.username=" + postgreSQLContainer.getUsername(),
"spring.datasource.password=" + postgreSQLContainer.getPassword()
).applyTo(configurableApplicationContext.getEnvironment());
}
}
@Test
public void contextLoads() {
}
}
When I execute mvn test I get this:
Error log:
09:54:24.292 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.294 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
09:54:24.298 [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)]
09:54:24.310 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
09:54:24.320 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: class path resource [de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplicationTests-context.xml] does not exist
09:54:24.320 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: class path resource [de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplicationTestsContext.groovy] does not exist
09:54:24.320 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}.
09:54:24.321 [main] DEBUG org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Ignoring class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests$Initializer]; it must be static, non-private, non-final, and annotated with @Configuration to be considered a default configuration class.
09:54:24.321 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: SpringBootHibernateFlywayBestPracticesApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
09:54:24.336 [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 [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.372 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [/Users/antonio/Downloads/blog-tutorials-master/spring-boot-hibernate-flyway-best-practices/target/classes/de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplication.class]
09:54:24.373 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplication for test class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests
09:54:24.412 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: using defaults.
09:54:24.412 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [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, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, 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]
09:54:24.418 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@93cf163, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@1852a3ff, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@7203c7ff, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@25bfcafd, org.springframework.test.context.support.DirtiesContextTestExecutionListener@4b6690c0, org.springframework.test.context.transaction.TransactionalTestExecutionListener@46268f08, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@2a76840c, org.springframework.test.context.event.EventPublishingTestExecutionListener@71454b9d, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@eda25e5, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@7cf6a5f9, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@623e088f, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@39fcbef6, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@66565121, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@2fc6f97f]
09:54:24.419 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.420 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.420 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.421 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.422 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.422 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.431 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.431 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
09:54:24.431 [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)]
09:54:24.432 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
09:54:24.432 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: class path resource [de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplicationTests-context.xml] does not exist
09:54:24.433 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: class path resource [de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplicationTestsContext.groovy] does not exist
09:54:24.433 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}.
09:54:24.433 [main] DEBUG org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Ignoring class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests$Initializer]; it must be static, non-private, non-final, and annotated with @Configuration to be considered a default configuration class.
09:54:24.433 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: SpringBootHibernateFlywayBestPracticesApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
09:54:24.434 [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 [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.434 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplication for test class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests
09:54:24.435 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: using defaults.
09:54:24.435 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [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, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, 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]
09:54:24.436 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@2c532cd8, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@294e5088, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@51972dc7, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@3700ec9c, org.springframework.test.context.support.DirtiesContextTestExecutionListener@2002348, org.springframework.test.context.transaction.TransactionalTestExecutionListener@5911e990, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@31000e60, org.springframework.test.context.event.EventPublishingTestExecutionListener@1d470d0, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@24d09c1, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@54c62d71, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@65045a87, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@47f4e407, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@2d1dee39, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@48d5f34e]
09:54:24.436 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.436 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.436 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.436 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.436 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.436 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.457 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.457 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
[INFO] Running de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests
09:54:24.458 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.458 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.458 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.458 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.475 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.475 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:54:24.483 [main] DEBUG org.testcontainers.utility.TestcontainersConfiguration - Testcontainers configuration overrides will be loaded from file:/Users/antonio/.testcontainers.properties
09:54:24.491 [main] DEBUG org.testcontainers.utility.CommandLine - Executing shell command: `docker-machine ls -q`
09:54:24.493 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Executing [docker-machine, ls, -q].
09:54:24.494 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Started Process[pid=1440, exitValue="not exited"]
09:54:24.604 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.WaitForProcess - Process[pid=1440, exitValue=0] stopped with exit code 0
09:54:24.604 [main] DEBUG org.testcontainers.utility.DockerMachineClient - DOCKER_MACHINE_NAME is not set; Using 'default' docker-machine
09:54:24.775 [ducttape-0] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Pinging docker daemon...
09:54:24.785 [ducttape-0] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd:
09:54:24.807 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - UnixSocketClientProviderStrategy: failed with exception RuntimeException (java.lang.UnsatisfiedLinkError: /Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: dlopen(/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp, 1): no suitable image found. Did find:
/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: no matching architecture in universal wrapper
/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: no matching architecture in universal wrapper). Root cause UnsatisfiedLinkError (/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: dlopen(/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp, 1): no suitable image found. Did find:
/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: no matching architecture in universal wrapper
/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: no matching architecture in universal wrapper)
09:54:24.807 [main] DEBUG org.testcontainers.utility.CommandLine - Executing shell command: `docker-machine ls -q`
09:54:24.808 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Executing [docker-machine, ls, -q].
09:54:24.810 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Started Process[pid=1442, exitValue="not exited"]
09:54:24.844 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.WaitForProcess - Process[pid=1442, exitValue=0] stopped with exit code 0
09:54:24.844 [main] DEBUG org.testcontainers.utility.DockerMachineClient - DOCKER_MACHINE_NAME is not set; Using 'default' docker-machine
09:54:24.844 [main] INFO org.testcontainers.dockerclient.DockerMachineClientProviderStrategy - Found docker-machine, and will use machine named default
09:54:24.844 [main] DEBUG org.testcontainers.utility.CommandLine - Executing shell command: `docker-machine status default`
09:54:24.844 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Executing [docker-machine, status, default].
09:54:24.846 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Started Process[pid=1444, exitValue="not exited"]
09:54:24.870 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.WaitForProcess - Process[pid=1444, exitValue=1] stopped with exit code 1
09:54:24.870 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - DockerMachineClientProviderStrategy: failed with exception ShellCommandException (Exception when executing docker-machine status default). Root cause InvalidExitValueException (Unexpected exit value: 1, allowed exit values: [0], executed command [docker-machine, status, default], output was 124 bytes:
error getting state for host default: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path)
09:54:24.871 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
09:54:24.871 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - UnixSocketClientProviderStrategy: failed with exception RuntimeException (java.lang.UnsatisfiedLinkError: /Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: dlopen(/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp, 1): no suitable image found. Did find:
/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: no matching architecture in universal wrapper
/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: no matching architecture in universal wrapper). Root cause UnsatisfiedLinkError (/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: dlopen(/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp, 1): no suitable image found. Did find:
/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: no matching architecture in universal wrapper
/Users/antonio/Library/Caches/JNA/temp/jna8589515278144772572.tmp: no matching architecture in universal wrapper)
09:54:24.871 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - DockerMachineClientProviderStrategy: failed with exception ShellCommandException (Exception when executing docker-machine status default). Root cause InvalidExitValueException (Unexpected exit value: 1, allowed exit values: [0], executed command [docker-machine, status, default], output was 124 bytes:
error getting state for host default: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path)
09:54:24.871 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - As no valid configuration was found, execution cannot continue
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.419 s <<< FAILURE! - in de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests
[ERROR] de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests Time elapsed: 0.418 s <<< ERROR!
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
As you can see I get:
... no suitable image found...ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - As no valid configuration was found, execution cannot continuejava.lang.IllegalStateException: Could not find a valid Docker environment.
I don't know if there is a way to solve this problem. In my view should work fine because I can run the docker containers by terminal then I should be able to run testcontainers.
The fact is I can run this test inside Docker as it's recommended for some scenarios in the docs.
The command is the following:
docker run -it --rm -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock maven:3 mvn test
Successful log:
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
09:16:27.263 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.266 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
09:16:27.272 [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)]
09:16:27.291 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
09:16:27.309 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: class path resource [de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplicationTests-context.xml] does not exist
09:16:27.311 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: class path resource [de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplicationTestsContext.groovy] does not exist
09:16:27.311 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}.
09:16:27.314 [main] DEBUG org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Ignoring class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests$Initializer]; it must be static, non-private, non-final, and annotated with @Configuration to be considered a default configuration class.
09:16:27.314 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: SpringBootHibernateFlywayBestPracticesApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
09:16:27.333 [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 [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.433 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [/Users/antonio/Downloads/blog-tutorials-master/spring-boot-hibernate-flyway-best-practices/target/classes/de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplication.class]
09:16:27.440 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplication for test class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests
09:16:27.491 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: using defaults.
09:16:27.491 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [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, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, 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]
09:16:27.504 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@407a7f2a, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@4ea5b703, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@2a7ed1f, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@3fa247d1, org.springframework.test.context.support.DirtiesContextTestExecutionListener@2cb2fc20, org.springframework.test.context.transaction.TransactionalTestExecutionListener@4f4c4b1a, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@723e88f9, org.springframework.test.context.event.EventPublishingTestExecutionListener@5f0fd5a0, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@64e7619d, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@495ee280, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@4fa1c212, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@6ea2bc93, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@3116c353, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@f627d13]
09:16:27.506 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.509 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.511 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.511 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.513 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.513 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.535 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.535 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
09:16:27.535 [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)]
09:16:27.535 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
09:16:27.540 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: class path resource [de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplicationTests-context.xml] does not exist
09:16:27.541 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: class path resource [de/rieckpil/blog/SpringBootHibernateFlywayBestPracticesApplicationTestsContext.groovy] does not exist
09:16:27.541 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}.
09:16:27.541 [main] DEBUG org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Ignoring class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests$Initializer]; it must be static, non-private, non-final, and annotated with @Configuration to be considered a default configuration class.
09:16:27.541 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: SpringBootHibernateFlywayBestPracticesApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
09:16:27.543 [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 [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.545 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplication for test class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests
09:16:27.547 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]: using defaults.
09:16:27.547 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [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, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, 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]
09:16:27.548 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@1d483de4, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@4032d386, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@28d18df5, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@934b6cb, org.springframework.test.context.support.DirtiesContextTestExecutionListener@55cf0d14, org.springframework.test.context.transaction.TransactionalTestExecutionListener@3b74ac8, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@27adc16e, org.springframework.test.context.event.EventPublishingTestExecutionListener@b83a9be, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@2609b277, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@1fd14d74, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@563e4951, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@4066c471, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@2b175c00, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@3eb81efb]
09:16:27.548 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.548 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.548 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.548 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.549 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.549 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.576 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.576 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
[INFO] Running de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests
09:16:27.578 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.578 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.582 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.583 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.609 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.609 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:27.622 [main] DEBUG org.testcontainers.utility.TestcontainersConfiguration - Testcontainers configuration overrides will be loaded from file:/root/.testcontainers.properties
09:16:27.629 [main] WARN org.testcontainers.utility.TestcontainersConfiguration - Attempted to read Testcontainers configuration file at file:/root/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: /root/.testcontainers.properties (No such file or directory)
09:16:27.636 [main] INFO org.testcontainers.dockerclient.DockerMachineClientProviderStrategy - docker-machine executable was not found on PATH ([/usr/java/openjdk-15/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin])
09:16:27.636 [main] DEBUG org.testcontainers.dockerclient.RootlessDockerClientProviderStrategy - $XDG_RUNTIME_DIR is not set.
09:16:27.636 [main] DEBUG org.testcontainers.dockerclient.RootlessDockerClientProviderStrategy - '/root/.docker/run' does not exist.
09:16:27.664 [main] DEBUG org.testcontainers.dockerclient.RootlessDockerClientProviderStrategy - '/run/user/0' does not exist.
09:16:27.922 [ducttape-0] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Pinging docker daemon...
09:16:27.932 [ducttape-0] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd:
09:16:28.022 [main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
09:16:28.022 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Transport type: 'okhttp', Docker host: 'unix:///var/run/docker.sock'
09:16:28.022 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Checking Docker OS type for local Unix socket (unix:///var/run/docker.sock)
09:16:28.032 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: bridge
09:16:28.041 [main] INFO org.testcontainers.DockerClientFactory - Docker host IP address is 172.17.0.1
09:16:28.044 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd:
09:16:28.056 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd:
09:16:28.071 [main] INFO org.testcontainers.DockerClientFactory - Connected to docker:
Server Version: 20.10.3
API Version: 1.41
Operating System: Docker Desktop
Total Memory: 1981 MB
09:16:28.071 [main] DEBUG org.testcontainers.DockerClientFactory - Ryuk is enabled
09:16:28.073 [main] INFO org.testcontainers.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
09:16:28.074 [main] DEBUG org.testcontainers.utility.PrefixingImageNameSubstitutor - No prefix is configured
09:16:28.074 [main] DEBUG org.testcontainers.utility.ImageNameSubstitutor - Did not find a substitute image for testcontainers/ryuk:0.3.1 (using image substitutor: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor'))
09:16:28.074 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: testcontainers/ryuk:0.3.1
09:16:28.094 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: testcontainers/ryuk:0.3.1 at registry: index.docker.io
09:16:28.095 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - RegistryAuthLocator has configFile: /root/.docker/config.json (does not exist) and commandPathPrefix:
09:16:28.095 [main] INFO org.testcontainers.utility.RegistryAuthLocator - Failure when attempting to lookup auth config. Please ignore if you don't have images in an authenticated registry. Details: (dockerImageName: testcontainers/ryuk:0.3.1, configFile: /root/.docker/config.json. Falling back to docker-java default behaviour. Exception message: /root/.docker/config.json (No such file or directory)
09:16:28.095 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - No matching Auth Configs - falling back to defaultAuthConfig [null]
09:16:28.095 [main] DEBUG org.testcontainers.dockerclient.AuthDelegatingDockerClientConfig - Effective auth config [null]
09:16:28.100 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: org.testcontainers.shaded.com.github.dockerjava.core.command.CreateContainerCmdImpl@5d52e3ef[name=testcontainers-ryuk-39392a2f-ef5e-4b27-b8a6-617d061b76b6,hostName=<null>,domainName=<null>,user=<null>,attachStdin=<null>,attachStdout=<null>,attachStderr=<null>,portSpecs=<null>,tty=<null>,stdinOpen=<null>,stdInOnce=<null>,env=<null>,cmd=<null>,healthcheck=<null>,argsEscaped=<null>,entrypoint=<null>,image=testcontainers/ryuk:0.3.1,volumes=com.github.dockerjava.api.model.Volumes@4c7a078,workingDir=<null>,macAddress=<null>,onBuild=<null>,networkDisabled=<null>,exposedPorts=com.github.dockerjava.api.model.ExposedPorts@4e406694,stopSignal=<null>,stopTimeout=<null>,hostConfig=HostConfig(binds=[/var/run/docker.sock:/var/run/docker.sock:rw], blkioWeight=null, blkioWeightDevice=null, blkioDeviceReadBps=null, blkioDeviceWriteBps=null, blkioDeviceReadIOps=null, blkioDeviceWriteIOps=null, memorySwappiness=null, nanoCPUs=null, capAdd=null, capDrop=null, containerIDFile=null, cpuPeriod=null, cpuRealtimePeriod=null, cpuRealtimeRuntime=null, cpuShares=null, cpuQuota=null, cpusetCpus=null, cpusetMems=null, devices=null, deviceCgroupRules=null, deviceRequests=null, diskQuota=null, dns=null, dnsOptions=null, dnsSearch=null, extraHosts=null, groupAdd=null, ipcMode=null, cgroup=null, links=[], logConfig=LogConfig(type=null, config=null), lxcConf=null, memory=null, memorySwap=null, memoryReservation=null, kernelMemory=null, networkMode=null, oomKillDisable=null, init=null, autoRemove=true, oomScoreAdj=null, portBindings=null, privileged=false, publishAllPorts=true, readonlyRootfs=null, restartPolicy=null, ulimits=null, cpuCount=null, cpuPercent=null, ioMaximumIOps=null, ioMaximumBandwidth=null, volumesFrom=null, mounts=null, pidMode=null, isolation=null, securityOpts=null, storageOpt=null, cgroupParent=null, volumeDriver=null, shmSize=null, pidsLimit=null, runtime=null, tmpFs=null, utSMode=null, usernsMode=null, sysctls=null, consoleSize=null),labels={org.testcontainers=true},shell=<null>,networkingConfig=<null>,ipv4Address=<null>,ipv6Address=<null>,aliases=<null>,authConfig=<null>]
09:16:28.526 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: 87f3a5362e19df2e1339d1af0de60780abe51ebe3ad515427d0abd520515244c
09:16:29.367 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: 87f3a5362e19df2e1339d1af0de60780abe51ebe3ad515427d0abd520515244c,false
09:16:29.368 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/87f3a5362e19df2e1339d1af0de60780abe51ebe3ad515427d0abd520515244c/json], queryParams={}}
09:16:29.437 [testcontainers-ryuk] DEBUG org.testcontainers.utility.ResourceReaper - Sending 'label=org.testcontainers%3Dtrue&label=org.testcontainers.sessionId%3D39392a2f-ef5e-4b27-b8a6-617d061b76b6' to Ryuk
09:16:29.438 [testcontainers-ryuk] DEBUG org.testcontainers.utility.ResourceReaper - Received 'ACK' from Ryuk
09:16:29.538 [main] INFO org.testcontainers.DockerClientFactory - Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
09:16:29.538 [main] DEBUG org.testcontainers.DockerClientFactory - Checks are enabled
09:16:29.539 [main] INFO org.testcontainers.DockerClientFactory - Checking the system...
09:16:29.541 [main] INFO org.testcontainers.DockerClientFactory - ✔︎ Docker server version should be at least 1.6.0
09:16:29.542 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: 87f3a5362e19df2e1339d1af0de60780abe51ebe3ad515427d0abd520515244c,<null>,true,<null>,<null>,<null>,<null>,{df,-P},<null>,<null>
09:16:29.603 [main] INFO org.testcontainers.DockerClientFactory - ✔︎ Docker environment should have more than 2GB free disk space
09:16:29.603 [main] DEBUG org.testcontainers.utility.PrefixingImageNameSubstitutor - No prefix is configured
09:16:29.603 [main] DEBUG org.testcontainers.utility.ImageNameSubstitutor - Did not find a substitute image for postgres:latest (using image substitutor: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor'))
09:16:29.605 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ListImagesCmdImpl[imageNameFilter=<null>,showAll=false,filters=org.testcontainers.shaded.com.github.dockerjava.core.util.FiltersBuilder@0]
09:16:29.613 [main] DEBUG org.testcontainers.images.AbstractImagePullPolicy - Using locally available and not pulling image: postgres:latest
09:16:29.613 [main] DEBUG 🐳 [postgres:latest] - Starting container: postgres:latest
09:16:29.614 [main] DEBUG 🐳 [postgres:latest] - Trying to start container: postgres:latest (attempt 1/1)
09:16:29.614 [main] DEBUG 🐳 [postgres:latest] - Starting container: postgres:latest
09:16:29.614 [main] INFO 🐳 [postgres:latest] - Creating container for image: postgres:latest
09:16:29.614 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: postgres:latest at registry: index.docker.io
09:16:29.614 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - No matching Auth Configs - falling back to defaultAuthConfig [null]
09:16:29.614 [main] DEBUG org.testcontainers.dockerclient.AuthDelegatingDockerClientConfig - Effective auth config [null]
09:16:29.617 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: org.testcontainers.shaded.com.github.dockerjava.core.command.CreateContainerCmdImpl@23eee4b8[name=<null>,hostName=<null>,domainName=<null>,user=<null>,attachStdin=<null>,attachStdout=<null>,attachStderr=<null>,portSpecs=<null>,tty=<null>,stdinOpen=<null>,stdInOnce=<null>,env={POSTGRES_USER=username,POSTGRES_PASSWORD=postgres,POSTGRES_DB=postgres},cmd={postgres,-c,fsync=off},healthcheck=<null>,argsEscaped=<null>,entrypoint=<null>,image=postgres:latest,volumes=com.github.dockerjava.api.model.Volumes@28952dea,workingDir=<null>,macAddress=<null>,onBuild=<null>,networkDisabled=<null>,exposedPorts=com.github.dockerjava.api.model.ExposedPorts@5a9800f8,stopSignal=<null>,stopTimeout=<null>,hostConfig=HostConfig(binds=[], blkioWeight=null, blkioWeightDevice=null, blkioDeviceReadBps=null, blkioDeviceWriteBps=null, blkioDeviceReadIOps=null, blkioDeviceWriteIOps=null, memorySwappiness=null, nanoCPUs=null, capAdd=null, capDrop=null, containerIDFile=null, cpuPeriod=null, cpuRealtimePeriod=null, cpuRealtimeRuntime=null, cpuShares=null, cpuQuota=null, cpusetCpus=null, cpusetMems=null, devices=null, deviceCgroupRules=null, deviceRequests=null, diskQuota=null, dns=null, dnsOptions=null, dnsSearch=null, extraHosts=[], groupAdd=null, ipcMode=null, cgroup=null, links=[], logConfig=LogConfig(type=null, config=null), lxcConf=null, memory=null, memorySwap=null, memoryReservation=null, kernelMemory=null, networkMode=null, oomKillDisable=null, init=null, autoRemove=null, oomScoreAdj=null, portBindings={}, privileged=null, publishAllPorts=true, readonlyRootfs=null, restartPolicy=null, ulimits=null, cpuCount=null, cpuPercent=null, ioMaximumIOps=null, ioMaximumBandwidth=null, volumesFrom=[], mounts=null, pidMode=null, isolation=null, securityOpts=null, storageOpt=null, cgroupParent=null, volumeDriver=null, shmSize=null, pidsLimit=null, runtime=null, tmpFs=null, utSMode=null, usernsMode=null, sysctls=null, consoleSize=null),labels={org.testcontainers=true, org.testcontainers.sessionId=39392a2f-ef5e-4b27-b8a6-617d061b76b6},shell=<null>,networkingConfig=<null>,ipv4Address=<null>,ipv6Address=<null>,aliases=<null>,authConfig=<null>]
09:16:29.959 [main] INFO 🐳 [postgres:latest] - Starting container with ID: cc6417dc96145e2a325164b47e60191c692424cc1511d68531ef5557bde67e38
09:16:29.959 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: cc6417dc96145e2a325164b47e60191c692424cc1511d68531ef5557bde67e38
09:16:30.656 [main] INFO 🐳 [postgres:latest] - Container postgres:latest is starting: cc6417dc96145e2a325164b47e60191c692424cc1511d68531ef5557bde67e38
09:16:30.657 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: cc6417dc96145e2a325164b47e60191c692424cc1511d68531ef5557bde67e38,false
09:16:30.658 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/cc6417dc96145e2a325164b47e60191c692424cc1511d68531ef5557bde67e38/json], queryParams={}}
09:16:30.666 [ducttape-0] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: cc6417dc96145e2a325164b47e60191c692424cc1511d68531ef5557bde67e38,false
09:16:30.666 [ducttape-0] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/cc6417dc96145e2a325164b47e60191c692424cc1511d68531ef5557bde67e38/json], queryParams={}}
09:16:30.731 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: The database cluster will be initialized with locale "en_US.utf8".
09:16:30.731 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: selecting dynamic shared memory implementation ... posix
09:16:30.731 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: creating subdirectories ... ok
09:16:30.731 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: fixing permissions on existing directory /var/lib/postgresql/data ... ok
09:16:30.732 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:30.732 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: Data page checksums are disabled.
09:16:30.732 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:30.732 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: The default text search configuration will be set to "english".
09:16:30.732 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: The default database encoding has accordingly been set to "UTF8".
09:16:30.733 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:30.733 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: This user must also own the server process.
09:16:30.733 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: The files belonging to this database system will be owned by user "postgres".
09:16:30.744 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: selecting default shared_buffers ... 128MB
09:16:30.744 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: selecting default max_connections ... 100
09:16:30.755 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: selecting default time zone ... Etc/UTC
09:16:30.765 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: creating configuration files ... ok
09:16:30.815 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: running bootstrap script ... ok
09:16:31.049 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: performing post-bootstrap initialization ... ok
09:16:31.200 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:31.200 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDERR: --auth-local and --auth-host, the next time you run initdb.
09:16:31.201 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDERR: You can change this by editing pg_hba.conf or using the option -A, or
09:16:31.201 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDERR: initdb: warning: enabling "trust" authentication for local connections
09:16:31.201 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:31.201 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: pg_ctl -D /var/lib/postgresql/data -l logfile start
09:16:31.201 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:31.201 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: Success. You can now start the database server using:
09:16:31.202 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:31.202 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: syncing data to disk ... ok
09:16:31.215 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2021-02-22 09:16:31.214 UTC [49] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
09:16:31.216 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: waiting for server to start....2021-02-22 09:16:31.214 UTC [49] LOG: starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
09:16:31.226 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2021-02-22 09:16:31.219 UTC [49] LOG: database system is ready to accept connections
09:16:31.226 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2021-02-22 09:16:31.215 UTC [50] LOG: database system was shut down at 2021-02-22 09:16:31 UTC
09:16:31.310 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: server started
09:16:31.310 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: done
09:16:31.361 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: .2021-02-22 09:16:31.360 UTC [49] LOG: aborting any active transactions
09:16:31.361 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2021-02-22 09:16:31.361 UTC [49] LOG: background worker "logical replication launcher" (PID 56) exited with exit code 1
09:16:31.361 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: waiting for server to shut down...2021-02-22 09:16:31.360 UTC [49] LOG: received fast shutdown request
09:16:31.362 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:31.362 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
09:16:31.362 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:31.373 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2021-02-22 09:16:31.365 UTC [49] LOG: database system is shut down
09:16:31.373 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2021-02-22 09:16:31.363 UTC [51] LOG: shutting down
09:16:31.466 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: PostgreSQL init process complete; ready for start up.
09:16:31.466 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:31.466 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT:
09:16:31.466 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: server stopped
09:16:31.466 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: done
09:16:31.478 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDERR: 2021-02-22 09:16:31.477 UTC [1] LOG: listening on IPv6 address "::", port 5432
09:16:31.479 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDERR: 2021-02-22 09:16:31.478 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
09:16:31.479 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDERR: 2021-02-22 09:16:31.477 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
09:16:31.479 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDERR: 2021-02-22 09:16:31.477 UTC [1] LOG: starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
09:16:31.490 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDERR: 2021-02-22 09:16:31.480 UTC [1] LOG: database system is ready to accept connections
09:16:31.591 [main] INFO 🐳 [postgres:latest] - Container postgres:latest started in PT1.987228501S
09:16:31.595 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@64e1dd11 testClass = SpringBootHibernateFlywayBestPracticesApplicationTests, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@5c089b2f testClass = SpringBootHibernateFlywayBestPracticesApplicationTests, locations = '{}', classes = '{class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplication}', contextInitializerClasses = '[class de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests$Initializer]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@fbd1f6, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@7a8c8dcf, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@24313fcc, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@71e9ddb4, org.springframework.boot.test.context.SpringBootTestArgs@1], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true]], class annotated with @DirtiesContext [false] with mode [null].
09:16:31.596 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:31.596 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests]
09:16:31.612 [main] DEBUG org.springframework.test.context.support.TestPropertySourceUtils - Adding inlined properties to environment: {spring.jmx.enabled=false, org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.0.RELEASE)
2021-02-22 09:16:31.847 INFO 77 --- [ main] rnateFlywayBestPracticesApplicationTests : Starting SpringBootHibernateFlywayBestPracticesApplicationTests on 1d7630c4430e with PID 77 (started by root in /Users/antonio/Downloads/blog-tutorials-master/spring-boot-hibernate-flyway-best-practices)
2021-02-22 09:16:31.849 INFO 77 --- [ main] rnateFlywayBestPracticesApplicationTests : No active profile set, falling back to default profiles: default
2021-02-22 09:16:32.287 INFO 77 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2021-02-22 09:16:32.389 INFO 77 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 96ms. Found 1 JPA repository interfaces.
2021-02-22 09:16:32.680 INFO 77 --- [ main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 6.4.1 by Redgate
2021-02-22 09:16:32.702 INFO 77 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-02-22 09:16:32.761 INFO 77 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-02-22 09:16:32.774 INFO 77 --- [ main] o.f.c.internal.database.DatabaseFactory : Database: jdbc:postgresql://172.17.0.1:55001/postgres (PostgreSQL 13.2)
2021-02-22 09:16:32.779 WARN 77 --- [ main] o.f.c.internal.database.base.Database : Flyway upgrade recommended: PostgreSQL 13.2 is newer than this version of Flyway and support has not been tested. The latest supported version of PostgreSQL is 12.
2021-02-22 09:16:32.832 INFO 77 --- [ main] o.f.core.internal.command.DbValidate : Successfully validated 6 migrations (execution time 00:00.046s)
2021-02-22 09:16:32.837 INFO 77 --- [ main] o.f.c.i.s.JdbcTableSchemaHistory : Creating Schema History table "public"."flyway_schema_history" ...
2021-02-22 09:16:32.858 INFO 77 --- [ main] o.f.core.internal.command.DbMigrate : Current version of schema "public": << Empty Schema >>
2021-02-22 09:16:32.956 INFO 77 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" to version 001 - CREATE BOOKS
2021-02-22 09:16:33.029 INFO 77 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" to version 002 - CREATE REVIEWS
2021-02-22 09:16:33.102 INFO 77 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" to version 003 - ADD DUMMY DATA
2021-02-22 09:16:33.111 INFO 77 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" to version 004 - UPDATE REVIEWS
2021-02-22 09:16:33.245 INFO 77 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" to version 005 - CREATE TAGS
2021-02-22 09:16:33.364 INFO 77 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" with repeatable migration BEST REVIEWED BOOKS VIEW
2021-02-22 09:16:33.368 INFO 77 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : DB: view "best_reviewed_books" does not exist, skipping
2021-02-22 09:16:33.373 INFO 77 --- [ main] o.f.core.internal.command.DbMigrate : Successfully applied 6 migrations to schema "public" (execution time 00:00.523s)
2021-02-22 09:16:33.455 INFO 77 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-02-22 09:16:33.516 INFO 77 --- [ task-1] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-02-22 09:16:33.563 INFO 77 --- [ task-1] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.15.Final
2021-02-22 09:16:33.663 WARN 77 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-02-22 09:16:33.706 INFO 77 --- [ task-1] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2021-02-22 09:16:33.796 INFO 77 --- [ task-1] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10Dialect
2021-02-22 09:16:34.154 INFO 77 --- [ task-1] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-02-22 09:16:34.158 INFO 77 --- [ task-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-02-22 09:16:34.500 INFO 77 --- [ main] DeferredRepositoryInitializationListener : Triggering deferred initialization of Spring Data repositories…
2021-02-22 09:16:34.542 INFO 77 --- [ main] DeferredRepositoryInitializationListener : Spring Data repositories initialized!
2021-02-22 09:16:34.550 INFO 77 --- [ main] rnateFlywayBestPracticesApplicationTests : Started SpringBootHibernateFlywayBestPracticesApplicationTests in 2.928 seconds (JVM running for 7.654)
BestReviewedBooks(bookId=4, bookName=JAKARTA EE, totalReviews=1, avgStars=5.00, maxStars=5, minStars=5)
BestReviewedBooks(bookId=5, bookName=JAVA SE 11, totalReviews=2, avgStars=4.00, maxStars=4, minStars=4)
BestReviewedBooks(bookId=2, bookName=SPRING BOOT, totalReviews=3, avgStars=3.67, maxStars=5, minStars=1)
BestReviewedBooks(bookId=3, bookName=MICROPROFILE, totalReviews=3, avgStars=3.67, maxStars=4, minStars=3)
BestReviewedBooks(bookId=1, bookName=JAVA EE, totalReviews=3, avgStars=3.33, maxStars=5, minStars=1)
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.93 s - in de.rieckpil.blog.SpringBootHibernateFlywayBestPracticesApplicationTests
2021-02-22 09:16:35.530 INFO 77 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-02-22 09:16:35.533 INFO 77 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-02-22 09:16:35.534 INFO 77 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-02-22 09:16:35.538 INFO 77 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.782 s
[INFO] Finished at: 2021-02-22T09:16:36Z
[INFO] ------------------------------------------------------------------------
As you can see I get:
...
09:16:29.613 [main] DEBUG 🐳 [postgres:latest] - Starting container: postgres:latest
09:16:29.614 [main] DEBUG 🐳 [postgres:latest] - Trying to start container: postgres:latest (attempt 1/1)
09:16:29.614 [main] DEBUG 🐳 [postgres:latest] - Starting container: postgres:latest
09:16:29.614 [main] INFO 🐳 [postgres:latest] - Creating container for image: postgres:latest
...
That works but is so slow for development, it will be perfect to find a solution for this.
Same for me. Tried with our production app and also testcontainers-workshop project. :(
@bsideup you're also using a M1 mac, you don't have such issues?
edit: this helped.
I'm having a similar issue with an M1 Mac and org.testcontainers postgresql
I've set my environment variable DOCKER_DEFAULT_PLATFORM=linux/amd64 in the hope it would work but I'm still seeing
com.github.dockerjava.api.exception.DockerClientException: Could not pull image: no matching manifest for linux/arm64/v8 in the manifest list entries
There doesn't seem to be a way of specifying platform and testcontainers doesn't seem to be respecting the env var - which seems to have taken effect with docker on the command line.
I'm surprised this has been around since Feb and there aren't more comments. 😞
testImplementation 'net.java.dev.jna:jna:5.7.0' is what helps me on M1 Mac to get testcontainers to work.
I got around my issue in the end. It was not postgres that was problematic once I dug into it.
I had to add checks.disable=true because there is no arm image available for the alpine one used on startup checks! 🤣
FTR it is also possible to set tinyimage.container.image to Alpine that supports ARM, e.g. alpine:3.13.5.
We will also update the image we're using to a newer one that supports ARM
/cc @rnorth
I got around my issue in the end. It was not postgres that was problematic once I dug into it.
I had to add checks.disable=true because there is no arm image available for the alpine one used on startup checks! 🤣
I solved the problem in the same way. add 'checks.disable=true' in the file '/Users/myuser/.testcontainers.properties' (MacOS)
I'd like to explain why I think this is an important feature request. At work, my team uses the Jooq Gradle plugin to bring up an ephemeral MySQL database at build time to generate jooq Java code. The plugin accepts a JDBC URL, and we point this to testcontainers' magical JDBC URLs. Something like this:
// build.gradle.kts
jdbc.apply {
url = "jdbc:tc:mysql:5.7.27://test"
}
This works wonderfully on x86 machines. But on M1 machines, this causes testcontainers to look for a linux/arm64/v8 mysql image. Oracle only publishes MySQL 5.7.x images for linux/amd64, so the Jooq Gradle plugin fails.
We've worked around this by adding logic to our build script to switch on the host machine's architecture, and to pull a mariadb image on M1 machines. (MariaDB does publish linux/arm64/v8 images.) This works okay because MariaDB aims for high compatibility with MySQL -- and our CI infrastructure is still x86, so that's still the authoritative gencode. But inevitably, we're starting to run into incompatibilities between the two DBs. And it's becoming more of a problem as more of our team switches to M1 machines.
I would really like for testcontainers to have a way to express "pull an image for a specific platform, regardless of the host platform". This could be:
- honoring the
DOCKER_DEFAULT_PLATFORMenv var - special setting in
.testcontainers.properties - special syntax in the magical JDBC URLs
- ...something else I'm not thinking of
Maintainers, WDYT? I'm happy to help implement this feature if you agree it's valuable. Or if there's a better workaround than the MariaDB hack, I'd love to hear it.
Very much in agreement with @Ubehebe.
I do not know how the --platform command-line arguments relates to the docker API itself, but assuming there is a working relationship, then having an addition withPlatform(String) on the GenericContainer class would be useful too.
To add to the above, the preliminary Gradle JOOQ Generator plugin utilises pretty much the same strategy.
Just to pile on here and leave a breadcrumb in case others face the same issue:
The SingleStore Developer Image also requires the --platform argument in order to run on m1 macs.
I have the same issue with MySQL 5.7 on Macbook Pro with M1 CPU.
GenericContainer allows to set the platform but this does not work with MySQLContainer:
JdbcDatabaseContainer jdbcDatabaseContainer =
new MySQLContainer(DockerImageName.parse("mysql").withTag("5.7"))
.withDatabaseName("foo")
.withUsername("bar")
.withPassword("baz")
.withInitScript("db/init.sql")
.withCreateContainerCmdModifier(cmd -> cmd.withPlatform("linux/x86_64") // <-- this is in context of GenericContainer instead of MySQLContainer
);
jdbcDatabaseContainer.start();
MySqlDbTestContainer.java:[22,44] incompatible types: org.testcontainers.containers.GenericContainer cannot be converted to org.testcontainers.containers.JdbcDatabaseContainer
It also does not work if I change the code to the following just results in immediatly not started MySQL container.
JdbcDatabaseContainer jdbcDatabaseContainer =
new MySQLContainer<>(DockerImageName.parse("mysql").withTag("5.7")) // adds <> so IntelliJ is happy
.withDatabaseName("foo")
.withUsername("bar")
.withPassword("baz")
.withInitScript("db/init.sql")
.withCreateContainerCmdModifier(cmd -> cmd.withPlatform("linux/x86_64"));
After doing some research, I found out that testcontainers forces the use of Docker API 1.32. But the Docker API only started supporting platform from 1.41. So even specifying platform in withCreateContainerCmdModifier() is useless, @DennisBecker. I think there are several solutions to this:
- use unversioned API
- use 1.41 for the default version
- provide some kind of detection mechanism to automatically identify the API version used by the server
- provide some configuration to support custom API version
DockerClientProviderStrategy: https://github.com/testcontainers/testcontainers-java/blob/cfb0c74e24b70e18e67e55d4b00ec4a0eb4df563/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java#L388-L390
Docker API Document:
How to change the default version to 1.41 ?
You can directly modify docker-java to use the API version in several ways:
- System Properties
- System Environment
- $HOME/.docker-java.properties
- classpath:/docker-java.properties
See docker-java/getting_started.md for details
you can set a breakpoint here:
org.testcontainers.shaded.com.github.dockerjava.core.DefaultDockerClientConfig#overrideDockerPropertiesWithSystemProperties
https://github.com/docker-java/docker-java/blob/84d7750d7f290c66f0ae18c88ab92a3cde2c804d/docker-java-core/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java#L209-L219
private static Properties overrideDockerPropertiesWithSystemProperties(Properties p, Properties systemProperties) {
Properties overriddenProperties = new Properties();
overriddenProperties.putAll(p);
for (String key : CONFIG_KEYS) {
if (systemProperties.containsKey(key)) {
overriddenProperties.setProperty(key, systemProperties.getProperty(key));
}
}
return overriddenProperties;
}
and see how it works:
https://github.com/docker-java/docker-java/blob/84d7750d7f290c66f0ae18c88ab92a3cde2c804d/docker-java-core/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java#L74
CONFIG_KEYS.add(API_VERSION);
https://github.com/docker-java/docker-java/blob/84d7750d7f290c66f0ae18c88ab92a3cde2c804d/docker-java-core/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java#L49
public static final String API_VERSION = "api.version";
so you just set
System.setProperty("api.version", "1.41");
and it seems to pick it up.
so the main ask here is that there be a way to globally set macos to use the linux/x86_64 images via a system property or something? (potentially for specific images). That seems reasonable to me, just want to make sure i understand.
Yes, it is.