testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
8.03k stars 1.65k forks source link

[Bug]: DOCKER_HOST tcp://docker:2375 is not listening in Gitlab #6446

Closed lrkwz closed 1 year ago

lrkwz commented 1 year ago

Module

Core

Testcontainers version

1.17.6

Using the latest Testcontainers version?

Yes

Host OS

Gitlab-ci

Host Arch

any

Docker version

latest

What happened?

I have a springboot application with some simple database tests

@DataJpaTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@TestPropertySource(properties = {
        "spring.datasource.url=jdbc:tc:postgresql:alpine:///test?TC_TMPFS=/testtmpfs:rw",
        "spring.jpa.hibernate.ddl-auto=create",
        "spring.jpa.show_sql=true"
        //"spring.jpa.properties.hibernate.default_schema: test"
})
class BikeEventLogTest {

    @Autowired
    EntityManager entityManager;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    private BikeEventLogRepository bikeEventLogRepository;
...

Test execute locally with no problem at all.

My .gitlab-ci.yml is

# DinD service is required for Testcontainers
services:
  - name: docker:dind
    # explicitly disable tls to avoid docker startup interruption
    # command: [ "--tls=false" ]

variables:
  # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
  MAVEN_OPTS: >-
    -Dhttps.protocols=TLSv1.2
    -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository
    -Dorg.slf4j.simpleLogger.showDateTime=true
    -Djava.awt.headless=true

  # As of Maven 3.3.0 instead of this you MAY define these options in `.mvn/maven.config` so the same config is used
  # when running from the command line.
  # As of Maven 3.6.1, the use of `--no-tranfer-progress` (or `-ntp`) suppresses download and upload messages. The use
  # of the `Slf4jMavenTransferListener` is no longer necessary.
  # `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
  MAVEN_CLI_OPTS: >-
    --batch-mode
    --errors
    --fail-at-end
    --show-version
    --no-transfer-progress
    -DinstallAtEnd=true
    -DdeployAtEnd=true

  # Instruct Testcontainers to use the daemon of DinD, use port 2735 for non-tls connections.
  # DOCKER_HOST: "tcp://docker:2375"
  # Instruct Docker not to start over TLS.
  DOCKER_TLS_CERTDIR: "/certs"
  # Improve performance with overlayfs.
  DOCKER_DRIVER: overlay2

# This template uses the latest Maven 3 release, e.g., 3.8.6, and OpenJDK 17 (LTS)
# for verifying and deploying images
# Maven 3.8.x REQUIRES HTTPS repositories.
# See https://maven.apache.org/docs/3.8.1/release-notes.html#how-to-fix-when-i-get-a-http-repository-blocked for more.
image: maven:3-openjdk-17

# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
# Be aware that `mvn deploy` will install the built jar into this repository. If you notice your cache size
# increasing, consider adding `-Dmaven.install.skip=true` to `MAVEN_OPTS` or in `.mvn/maven.config`
cache:
  paths:
    - .m2/repository

# For merge requests do not `deploy` but only run `verify`.
# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
.verify:
  stage: test
  script:
    - 'mvn $MAVEN_CLI_OPTS verify'
  except:
    variables:
      - $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

# Verify merge requests using JDK17
verify:jdk17:
  extends:
    - .verify

when executed on gitlab CI (shared runner) the test fail with the following output

Relevant log output

Running with gitlab-runner 15.6.0~beta.186.ga889181a (a889181a)
  on blue-1.shared.runners-manager.gitlab.com/default j1aLDqxS
section_start:1675094007:prepare_executor
Preparing the "docker+machine" executor
Using Docker executor with image maven:3-openjdk-17 ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:13e76db19a191647d74efa689b7a05d564f06c68ca108bff31a7d439511f0f02 for docker:dind with digest docker@sha256:4dc065bd0c29c4eb33f0e9a28480930a8227e353a60bff2610c485f1fe01a89e ...
Waiting for services to be up and running (timeout 30 seconds)...

*** WARNING: Service runner-j1aldqxs-project-17373475-concurrent-0-790b4587180aaea8-docker-0 probably didn't start properly.

Health check error:
service "runner-j1aldqxs-project-17373475-concurrent-0-790b4587180aaea8-docker-0-wait-for-service" timeout

Health check container logs:

Service container logs:
2023-01-30T15:53:50.077966221Z Certificate request self-signature ok
2023-01-30T15:53:50.078854308Z subject=CN = docker:dind server
2023-01-30T15:53:50.101841419Z /certs/server/cert.pem: OK
2023-01-30T15:53:55.791250442Z Certificate request self-signature ok
2023-01-30T15:53:55.792042302Z subject=CN = docker:dind client
2023-01-30T15:53:55.814505918Z /certs/client/cert.pem: OK
2023-01-30T15:53:55.903070800Z time="2023-01-30T15:53:55.902947256Z" level=info msg="Starting up"
2023-01-30T15:53:55.904766152Z time="2023-01-30T15:53:55.904688538Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
2023-01-30T15:53:55.905831898Z time="2023-01-30T15:53:55.905772663Z" level=info msg="libcontainerd: started new containerd process" pid=57
2023-01-30T15:53:55.905922760Z time="2023-01-30T15:53:55.905895495Z" level=info msg="parsed scheme: \"unix\"" module=grpc
2023-01-30T15:53:55.905988491Z time="2023-01-30T15:53:55.905963739Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
2023-01-30T15:53:55.906083029Z time="2023-01-30T15:53:55.906048121Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
2023-01-30T15:53:55.906136835Z time="2023-01-30T15:53:55.906115335Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
2023-01-30T15:53:55.923861630Z time="2023-01-30T15:53:55Z" level=warning msg="containerd config version `1` has been deprecated and will be removed in containerd v2.0, please switch to version `2`, see https://github.com/containerd/containerd/blob/main/docs/PLUGINS.md#version-header"
2023-01-30T15:53:55.924946704Z time="2023-01-30T15:53:55.924875356Z" level=info msg="starting containerd" revision=5b842e528e99d4d4c1686467debf2bd4b88ecd86 version=v1.6.15
2023-01-30T15:53:55.940594999Z time="2023-01-30T15:53:55.940488324Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1
2023-01-30T15:53:55.940870885Z time="2023-01-30T15:53:55.940815933Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1
2023-01-30T15:53:55.946924690Z time="2023-01-30T15:53:55.946774918Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="aufs is not supported (modprobe aufs failed: exit status 1 \"ip: can't find device 'aufs'\\nmodprobe: can't change directory to '/lib/modules': No such file or directory\\n\"): skip plugin" type=io.containerd.snapshotter.v1
2023-01-30T15:53:55.947015469Z time="2023-01-30T15:53:55.946977973Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.btrfs\"..." type=io.containerd.snapshotter.v1
2023-01-30T15:53:55.947362725Z time="2023-01-30T15:53:55.947302395Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.btrfs\"..." error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs (ext4) must be a btrfs filesystem to be used with the btrfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
2023-01-30T15:53:55.947459113Z time="2023-01-30T15:53:55.947391114Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1
2023-01-30T15:53:55.947553307Z time="2023-01-30T15:53:55.947497204Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured"
2023-01-30T15:53:55.947620394Z time="2023-01-30T15:53:55.947581352Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1
2023-01-30T15:53:55.947807492Z time="2023-01-30T15:53:55.947764791Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1
2023-01-30T15:53:55.948109012Z time="2023-01-30T15:53:55.948055566Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1
2023-01-30T15:53:55.948398034Z time="2023-01-30T15:53:55.948347964Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
2023-01-30T15:53:55.948467524Z time="2023-01-30T15:53:55.948430205Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1
2023-01-30T15:53:55.948608534Z time="2023-01-30T15:53:55.948560434Z" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured"
2023-01-30T15:53:55.948659973Z time="2023-01-30T15:53:55.948632954Z" level=info msg="metadata content store policy set" policy=shared
2023-01-30T15:53:55.955230971Z time="2023-01-30T15:53:55.955142834Z" level=info msg="loading plugin \"io.containerd.differ.v1.walking\"..." type=io.containerd.differ.v1
2023-01-30T15:53:55.955338682Z time="2023-01-30T15:53:55.955293172Z" level=info msg="loading plugin \"io.containerd.event.v1.exchange\"..." type=io.containerd.event.v1
2023-01-30T15:53:55.955408403Z time="2023-01-30T15:53:55.955368844Z" level=info msg="loading plugin \"io.containerd.gc.v1.scheduler\"..." type=io.containerd.gc.v1
2023-01-30T15:53:55.955513474Z time="2023-01-30T15:53:55.955457136Z" level=info msg="loading plugin \"io.containerd.service.v1.introspection-service\"..." type=io.containerd.service.v1
2023-01-30T15:53:55.955617000Z time="2023-01-30T15:53:55.955569362Z" level=info msg="loading plugin \"io.containerd.service.v1.containers-service\"..." type=io.containerd.service.v1
2023-01-30T15:53:55.955693659Z time="2023-01-30T15:53:55.955648242Z" level=info msg="loading plugin \"io.containerd.service.v1.content-service\"..." type=io.containerd.service.v1
2023-01-30T15:53:55.955755725Z time="2023-01-30T15:53:55.955721280Z" level=info msg="loading plugin \"io.containerd.service.v1.diff-service\"..." type=io.containerd.service.v1
2023-01-30T15:53:55.956071015Z time="2023-01-30T15:53:55.956015157Z" level=info msg="loading plugin \"io.containerd.service.v1.images-service\"..." type=io.containerd.service.v1
2023-01-30T15:53:55.956178416Z time="2023-01-30T15:53:55.956109293Z" level=info msg="loading plugin \"io.containerd.service.v1.leases-service\"..." type=io.containerd.service.v1
2023-01-30T15:53:55.956255812Z time="2023-01-30T15:53:55.956211352Z" level=info msg="loading plugin \"io.containerd.service.v1.namespaces-service\"..." type=io.containerd.service.v1
2023-01-30T15:53:55.956341748Z time="2023-01-30T15:53:55.956294251Z" level=info msg="loading plugin \"io.containerd.service.v1.snapshots-service\"..." type=io.containerd.service.v1
2023-01-30T15:53:55.956414562Z time="2023-01-30T15:53:55.956370274Z" level=info msg="loading plugin \"io.containerd.runtime.v1.linux\"..." type=io.containerd.runtime.v1
2023-01-30T15:53:55.956712078Z time="2023-01-30T15:53:55.956652595Z" level=info msg="loading plugin \"io.containerd.runtime.v2.task\"..." type=io.containerd.runtime.v2
2023-01-30T15:53:55.956932359Z time="2023-01-30T15:53:55.956881066Z" level=info msg="loading plugin \"io.containerd.monitor.v1.cgroups\"..." type=io.containerd.monitor.v1
2023-01-30T15:53:55.957414022Z time="2023-01-30T15:53:55.957353115Z" level=info msg="loading plugin \"io.containerd.service.v1.tasks-service\"..." type=io.containerd.service.v1
2023-01-30T15:53:55.957528362Z time="2023-01-30T15:53:55.957483252Z" level=info msg="loading plugin \"io.containerd.grpc.v1.introspection\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.957619890Z time="2023-01-30T15:53:55.957579529Z" level=info msg="loading plugin \"io.containerd.internal.v1.restart\"..." type=io.containerd.internal.v1
2023-01-30T15:53:55.957745020Z time="2023-01-30T15:53:55.957701121Z" level=info msg="loading plugin \"io.containerd.grpc.v1.containers\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.957809162Z time="2023-01-30T15:53:55.957771736Z" level=info msg="loading plugin \"io.containerd.grpc.v1.content\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.957882671Z time="2023-01-30T15:53:55.957840245Z" level=info msg="loading plugin \"io.containerd.grpc.v1.diff\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.957947070Z time="2023-01-30T15:53:55.957912096Z" level=info msg="loading plugin \"io.containerd.grpc.v1.events\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.958024067Z time="2023-01-30T15:53:55.957982534Z" level=info msg="loading plugin \"io.containerd.grpc.v1.healthcheck\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.958085715Z time="2023-01-30T15:53:55.958049848Z" level=info msg="loading plugin \"io.containerd.grpc.v1.images\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.958162637Z time="2023-01-30T15:53:55.958119800Z" level=info msg="loading plugin \"io.containerd.grpc.v1.leases\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.958223701Z time="2023-01-30T15:53:55.958187697Z" level=info msg="loading plugin \"io.containerd.grpc.v1.namespaces\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.958298907Z time="2023-01-30T15:53:55.958255572Z" level=info msg="loading plugin \"io.containerd.internal.v1.opt\"..." type=io.containerd.internal.v1
2023-01-30T15:53:55.958670055Z time="2023-01-30T15:53:55.958607818Z" level=info msg="loading plugin \"io.containerd.grpc.v1.snapshots\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.958767930Z time="2023-01-30T15:53:55.958704010Z" level=info msg="loading plugin \"io.containerd.grpc.v1.tasks\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.958828448Z time="2023-01-30T15:53:55.958794387Z" level=info msg="loading plugin \"io.containerd.grpc.v1.version\"..." type=io.containerd.grpc.v1
2023-01-30T15:53:55.958905580Z time="2023-01-30T15:53:55.958863877Z" level=info msg="loading plugin \"io.containerd.tracing.processor.v1.otlp\"..." type=io.containerd.tracing.processor.v1
2023-01-30T15:53:55.958983601Z time="2023-01-30T15:53:55.958933928Z" level=info msg="skip loading plugin \"io.containerd.tracing.processor.v1.otlp\"..." error="no OpenTelemetry endpoint: skip plugin" type=io.containerd.tracing.processor.v1
2023-01-30T15:53:55.959052054Z time="2023-01-30T15:53:55.959009500Z" level=info msg="loading plugin \"io.containerd.internal.v1.tracing\"..." type=io.containerd.internal.v1
2023-01-30T15:53:55.959130672Z time="2023-01-30T15:53:55.959085510Z" level=error msg="failed to initialize a tracing processor \"otlp\"" error="no OpenTelemetry endpoint: skip plugin"
2023-01-30T15:53:55.959447233Z time="2023-01-30T15:53:55.959390345Z" level=info msg=serving... address=/var/run/docker/containerd/containerd-debug.sock
2023-01-30T15:53:55.959614487Z time="2023-01-30T15:53:55.959567406Z" level=info msg=serving... address=/var/run/docker/containerd/containerd.sock.ttrpc
2023-01-30T15:53:55.959771639Z time="2023-01-30T15:53:55.959723908Z" level=info msg=serving... address=/var/run/docker/containerd/containerd.sock
2023-01-30T15:53:55.959847605Z time="2023-01-30T15:53:55.959803915Z" level=info msg="containerd successfully booted in 0.036326s"
2023-01-30T15:53:55.979180767Z time="2023-01-30T15:53:55.979059307Z" level=info msg="Setting the storage driver from the $DOCKER_DRIVER environment variable (overlay2)"
2023-01-30T15:53:55.979454428Z time="2023-01-30T15:53:55.979397738Z" level=info msg="parsed scheme: \"unix\"" module=grpc
2023-01-30T15:53:55.979562719Z time="2023-01-30T15:53:55.979493813Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
2023-01-30T15:53:55.979671126Z time="2023-01-30T15:53:55.979615734Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
2023-01-30T15:53:55.979742953Z time="2023-01-30T15:53:55.979698549Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
2023-01-30T15:53:55.984758150Z time="2023-01-30T15:53:55.984665421Z" level=info msg="parsed scheme: \"unix\"" module=grpc
2023-01-30T15:53:55.984843391Z time="2023-01-30T15:53:55.984801686Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
2023-01-30T15:53:55.984942248Z time="2023-01-30T15:53:55.984897514Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
2023-01-30T15:53:55.985030809Z time="2023-01-30T15:53:55.984992416Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
2023-01-30T15:53:56.009045450Z time="2023-01-30T15:53:56.008918719Z" level=warning msg="Your kernel does not support cgroup blkio weight"
2023-01-30T15:53:56.009148798Z time="2023-01-30T15:53:56.009105438Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"
2023-01-30T15:53:56.009464353Z time="2023-01-30T15:53:56.009384733Z" level=info msg="Loading containers: start."
2023-01-30T15:53:56.059830716Z time="2023-01-30T15:53:56.059688086Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.18.0.0/16. Daemon option --bip can be used to set a preferred IP address"
2023-01-30T15:53:56.091205546Z time="2023-01-30T15:53:56.091044956Z" level=info msg="Loading containers: done."
2023-01-30T15:53:56.100566722Z time="2023-01-30T15:53:56.100404980Z" level=info msg="Docker daemon" commit=6051f14 graphdriver(s)=overlay2 version=20.10.23
2023-01-30T15:53:56.100834274Z time="2023-01-30T15:53:56.100755172Z" level=info msg="Daemon has completed initialization"
2023-01-30T15:53:56.279770761Z time="2023-01-30T15:53:56.279590189Z" level=info msg="API listen on [::]:2376"
2023-01-30T15:53:56.279999153Z time="2023-01-30T15:53:56.279919824Z" level=info msg="API listen on /var/run/docker.sock"

*********

Pulling docker image maven:3-openjdk-17 ...
Using docker image sha256:db741528e48aea788f63f806230fd5b3f0edcd0508dedd00357f069bc0c37ea0 for maven:3-openjdk-17 with digest maven@sha256:3a9c30b3af6278a8ae0007d3a3bf00fff80ec3ed7ae4eb9bfa1772853101549b ...
section_end:1675094074:prepare_executor
section_start:1675094074:prepare_script
Preparing environment
Running on runner-j1aldqxs-project-17373475-concurrent-0 via runner-j1aldqxs-shared-1675093919-ec020d16...
section_end:1675094077:prepare_script
section_start:1675094077:get_sources
Getting source from Git repository
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/bmbs/bmbs-domain/.git/
Created fresh repository.
Checking out 6877cfff as feature/1-storico-degli-eventi-sulla-bicicletta...

Skipping Git submodules setup
section_end:1675094078:get_sources
section_start:1675094078:restore_cache
Restoring cache
Checking cache for default-non_protected...
Downloading cache.zip from https://storage.googleapis.com/gitlab-com-runners-cache/project/17373475/default-non_protected 
Successfully extracted cache
section_end:1675094081:restore_cache
section_start:1675094081:step_script
Executing "step_script" stage of the job script
Using docker image sha256:db741528e48aea788f63f806230fd5b3f0edcd0508dedd00357f069bc0c37ea0 for maven:3-openjdk-17 with digest maven@sha256:3a9c30b3af6278a8ae0007d3a3bf00fff80ec3ed7ae4eb9bfa1772853101549b ...
$ mvn $MAVEN_CLI_OPTS verify
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /usr/share/maven
Java version: 17.0.2, vendor: Oracle Corporation, runtime: /usr/java/openjdk-17
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.4.109+", arch: "amd64", family: "unix"
1880 [INFO] Error stacktraces are turned on.
1974 [INFO] Scanning for projects...
3481 [INFO] 
3481 [INFO] ------------------------< it.bmbs:bmbs-domain >-------------------------
3484 [INFO] Building bmbs-domain 0.0.1-SNAPSHOT
3484 [INFO] --------------------------------[ jar ]---------------------------------
6072 [INFO] 
6077 [INFO] --- maven-resources-plugin:3.3.0:resources (default-resources) @ bmbs-domain ---
6288 [INFO] Copying 1 resource
6308 [INFO] Copying 1 resource
6312 [INFO] 
6313 [INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ bmbs-domain ---
6601 [INFO] Changes detected - recompiling the module!
6606 [INFO] Compiling 7 source files to /builds/bmbs/bmbs-domain/target/classes
10181 [WARNING] system modules path not set in conjunction with -source 11
10182 [WARNING] The following options were not recognized by any processor: '[mapstruct.verbose, mapstruct.suppressGeneratorVersionInfoComment, mapstruct.suppressGeneratorTimestamp]'
10183 [INFO] /builds/bmbs/bmbs-domain/src/main/java/it/bmbs/utils/HashMapConverter.java: /builds/bmbs/bmbs-domain/src/main/java/it/bmbs/utils/HashMapConverter.java uses unchecked or unsafe operations.
10186 [INFO] /builds/bmbs/bmbs-domain/src/main/java/it/bmbs/utils/HashMapConverter.java: Recompile with -Xlint:unchecked for details.
10187 [INFO] 
10188 [INFO] --- maven-resources-plugin:3.3.0:testResources (default-testResources) @ bmbs-domain ---
10199 [INFO] Copying 2 resources
10201 [INFO] 
10201 [INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ bmbs-domain ---
10218 [INFO] Changes detected - recompiling the module!
10219 [INFO] Compiling 10 source files to /builds/bmbs/bmbs-domain/target/test-classes
12334 [WARNING] system modules path not set in conjunction with -source 11
12335 [WARNING] The following options were not recognized by any processor: '[mapstruct.verbose, mapstruct.suppressGeneratorVersionInfoComment, mapstruct.suppressGeneratorTimestamp]'
12336 [INFO] 
12336 [INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ bmbs-domain ---
12700 [INFO] Surefire report directory: /builds/bmbs/bmbs-domain/target/surefire-reports
12916 [INFO] 
12916 [INFO] -------------------------------------------------------
12917 [INFO]  T E S T S
12917 [INFO] -------------------------------------------------------
14427 [INFO] Running it.bmbs.TestOwnerConstraints
15:54:57.334 [main] INFO  org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [it.bmbs.TestOwnerConstraints]: TestOwnerConstraints does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
15:54:57.592 [main] INFO  org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration it.bmbs.TestApplication for test class it.bmbs.TestOwnerConstraints

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.0.1)

15:54:58.407 [main] INFO  it.bmbs.TestOwnerConstraints - Starting TestOwnerConstraints using Java 17.0.2 with PID 65 (started by root in /builds/bmbs/bmbs-domain)
15:54:58.413 [main] INFO  it.bmbs.TestOwnerConstraints - No active profile set, falling back to 1 default profile: "default"
15:54:59.012 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
15:54:59.133 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 109 ms. Found 5 JPA repository interfaces.
15:55:00.093 [main] INFO  org.hibernate.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default]
15:55:00.187 [main] INFO  org.hibernate.Version - HHH000412: Hibernate ORM core version 6.1.6.Final
15:55:00.467 [main] WARN  org.hibernate.orm.deprecation - HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
15:55:00.708 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
15:55:00.813 [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)
15:55:00.819 [main] INFO  org.testcontainers.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
15:55:00.901 [main] WARN  org.testcontainers.dockerclient.DockerClientProviderStrategy - DOCKER_HOST tcp://docker:2375 is not listening
15:55:00.977 [main] INFO  org.testcontainers.dockerclient.DockerMachineClientProviderStrategy - docker-machine executable was not found on PATH ([/usr/java/openjdk-17/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin])
15:55:00.979 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
    UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Could not find unix domain socket). Root cause NoSuchFileException (/var/run/docker.sock)As no valid configuration was found, execution cannot continue.
See https://www.testcontainers.org/on_failure.html for more details.
15:55:01.981 [main] ERROR com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Exception during pool initialization.
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration

Additional Information

No response

eddumelendez commented 1 year ago

Hi @lrkwz have you check Testcontainers docs regarding to Gitlab CI?

HofmeisterAn commented 1 year ago

There has been a recent blog post about running Testcontainers in GitLab CI, maybe that one help.

lrkwz commented 1 year ago

There has been a recent blog post about running Testcontainers in GitLab CI, maybe that one help.

Thank you both @eddumelendez and @HofmeisterAn , I've read (again) both the docs and the blog post ... no success; I've also gave a spin to the cloud configuration but still no luck

Installing Testcontainers Cloud Agent...
\033[0m
Downloading https://app.testcontainers.cloud/download/testcontainers-cloud-agent_linux_x86-64
\033[0;32mSUCCESSFULLY DOWNLOADED!\033[0m
\033[0;90mVersion: "Oracle Linux Server 8.5/ol (8.5)" version=1.3.23.1890+2285c8e\033[0m
Launching \033[0;36mtcc-agent\033[0m...
2023-02-01T11:24:18.379Z --- INF Testcontainers Cloud Agent arch=amd64 os="Oracle Linux Server 8.5/ol (8.5)" version=1.3.23.1890+2285c8e
2023-02-01T11:24:18.379Z --- INF Testcontainers Cloud Agent arch=amd64 os="Oracle Linux Server 8.5/ol (8.5)" version=1.3.23.1890+2285c8e
2023-02-01T11:24:18.380Z --- INF Waiting up to 120 seconds for the agent to start...
2023-02-01T11:24:18.936Z --- INF Starting a listener...
2023-02-01T11:24:18.938Z --- INF Listening address=tcp://127.0.0.1:44209
2023-02-01T11:24:20.146Z --- INF Discovered endpoints count=28
2023-02-01T11:24:20.146Z --- INF Eligible endpoints count=28 endpoints=["zone-gcp-asia-east2-a-cluster-ap2","zone-gcp-asia-northeast3-a-cluster-ap2","zone-vultr-bom-cluster-ap2","zone-gcp-europe-central2-b-cluster-eu4","zone-gcp-europe-north1-b-cluster-eu3","zone-gcp-europe-southwest1-b-cluster-eu3","zone-gcp-europe-west2-b-cluster-eu3","zone-gcp-europe-west3-b-cluster-eu4","zone-gcp-europe-west4-b-cluster-eu3","zone-gcp-europe-west6-b-cluster-eu4","zone-vultr-ewr-cluster-us3","zone-vultr-lhr-cluster-eu4","zone-gcp-me-west1-a-cluster-eu4","zone-vultr-mex-cluster-us5","zone-gcp-northamerica-northeast2-a-cluster-us4","zone-vultr-nrt-cluster-ap2","zone-vultr-sgp-cluster-ap2","zone-gcp-southamerica-east1-a-cluster-sa2","zone-gcp-southamerica-west1-a-cluster-sa2","zone-vultr-syd-cluster-ap2","zone-gcp-us-central1-a-cluster-us5","zone-gcp-us-east1-c-cluster-us4","zone-gcp-us-east4-b-cluster-us4","zone-gcp-us-east5-a-cluster-us4","zone-gcp-us-east5-b-cluster-us3","zone-gcp-us-south1-a-cluster-us4","zone-gcp-us-west1-b-cluster-us5","zone-gcp-us-west2-a-cluster-us5"]
2023-02-01T11:24:20.147Z --- INF Trying to find a server attempt=1 max_latency=15
2023-02-01T11:24:20.153Z --- INF Obtaining a lease cached= endpoint=https://eks-us.workloads.testcontainers.cloud/lease?zone=gcp-us-east1-c index=0
2023-02-01T11:24:20.154Z --- INF Picked server id=zone-gcp-us-east1-c-cluster-us4 index=0 responded=6 server=35.243.131.59
2023-02-01T11:24:24.127Z --- INF Opening direct connection endpoint=34.139.86.45:30608
2023-02-01T11:24:24.128Z --- INF Obtained a lease datacenter_id=zone-gcp-us-east1-c-cluster-us4 endpoint=https://eks-us.workloads.testcontainers.cloud/lease?zone=gcp-us-east1-c index=0 lease_id=33065713-a93f-4a41-9a57-796e1bc18f01
2023-02-01T11:24:24.129Z --- INF Initial connection successful connector=docker.direct
2023-02-01T11:24:24.165Z --- INF Created a reverse proxy
$ mvn $MAVEN_CLI_OPTS deploy --settings ci_settings.xml
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /usr/share/maven
Java version: 17.0.2, vendor: Oracle Corporation, runtime: /usr/java/openjdk-17
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.4.109+", arch: "amd64", family: "unix"
2023-02-01T11:24:25.167Z --- INF Extending the lease index=0 lease_id=33065713-a93f-4a41-9a57-796e1bc18f01
2004 [INFO] Error stacktraces are turned on.
2103 [INFO] Scanning for projects...
9951 [INFO] 
9952 [INFO] ------------------------< it.bmbs:bmbs-domain >-------------------------
9955 [INFO] Building bmbs-domain 0.0.1-SNAPSHOT
9956 [INFO] --------------------------------[ jar ]---------------------------------
32196 [INFO] 
32197 [INFO] --- maven-resources-plugin:3.3.0:resources (default-resources) @ bmbs-domain ---
32941 [INFO] Copying 1 resource
32969 [INFO] Copying 1 resource
32973 [INFO] 
32974 [INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ bmbs-domain ---
34617 [INFO] Changes detected - recompiling the module!
34623 [INFO] Compiling 8 source files to /builds/bmbs/bmbs-domain/target/classes
38442 [WARNING] system modules path not set in conjunction with -source 11
38444 [WARNING] The following options were not recognized by any processor: '[mapstruct.verbose, mapstruct.suppressGeneratorVersionInfoComment, mapstruct.suppressGeneratorTimestamp]'
38444 [INFO] /builds/bmbs/bmbs-domain/src/main/java/it/bmbs/utils/HashMapConverter.java: /builds/bmbs/bmbs-domain/src/main/java/it/bmbs/utils/HashMapConverter.java uses unchecked or unsafe operations.
38445 [INFO] /builds/bmbs/bmbs-domain/src/main/java/it/bmbs/utils/HashMapConverter.java: Recompile with -Xlint:unchecked for details.
38446 [INFO] 
38446 [INFO] --- maven-resources-plugin:3.3.0:testResources (default-testResources) @ bmbs-domain ---
38460 [INFO] Copying 2 resources
38461 [INFO] 
38462 [INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ bmbs-domain ---
38478 [INFO] Changes detected - recompiling the module!
38480 [INFO] Compiling 12 source files to /builds/bmbs/bmbs-domain/target/test-classes
40678 [WARNING] system modules path not set in conjunction with -source 11
40684 [WARNING] The following options were not recognized by any processor: '[mapstruct.verbose, mapstruct.suppressGeneratorVersionInfoComment, mapstruct.suppressGeneratorTimestamp]'
40685 [INFO] 
40685 [INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ bmbs-domain ---
43132 [INFO] Surefire report directory: /builds/bmbs/bmbs-domain/target/surefire-reports
43628 [INFO] 
43633 [INFO] -------------------------------------------------------
43633 [INFO]  T E S T S
43634 [INFO] -------------------------------------------------------
45165 [INFO] Running it.bmbs.TestOwnerConstraints
11:25:10.472 [main] INFO  org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [it.bmbs.TestOwnerConstraints]: TestOwnerConstraints does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
11:25:10.762 [main] INFO  org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration it.bmbs.TestApplication for test class it.bmbs.TestOwnerConstraints
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.0.1)
11:25:11.632 [main] INFO  it.bmbs.TestOwnerConstraints - Starting TestOwnerConstraints using Java 17.0.2 with PID 112 (started by root in /builds/bmbs/bmbs-domain)
11:25:11.635 [main] INFO  it.bmbs.TestOwnerConstraints - No active profile set, falling back to 1 default profile: "default"
11:25:12.303 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
11:25:12.457 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 137 ms. Found 6 JPA repository interfaces.
11:25:13.517 [main] INFO  org.hibernate.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default]
11:25:13.603 [main] INFO  org.hibernate.Version - HHH000412: Hibernate ORM core version 6.1.6.Final
11:25:13.908 [main] WARN  org.hibernate.orm.deprecation - HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
11:25:14.180 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
11:25:14.282 [main] INFO  org.testcontainers.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2023-02-01T11:25:15.616Z --- INF Discovered endpoints count=28
2023-02-01T11:25:15.616Z --- INF Eligible endpoints count=28 endpoints=["zone-gcp-asia-east2-a-cluster-ap2","zone-gcp-asia-northeast3-a-cluster-ap2","zone-vultr-bom-cluster-ap2","zone-gcp-europe-central2-b-cluster-eu4","zone-gcp-europe-north1-b-cluster-eu3","zone-gcp-europe-southwest1-b-cluster-eu3","zone-gcp-europe-west2-b-cluster-eu3","zone-gcp-europe-west3-b-cluster-eu4","zone-gcp-europe-west4-b-cluster-eu3","zone-gcp-europe-west6-b-cluster-eu4","zone-vultr-ewr-cluster-us3","zone-vultr-lhr-cluster-eu4","zone-gcp-me-west1-a-cluster-eu4","zone-vultr-mex-cluster-us5","zone-gcp-northamerica-northeast2-a-cluster-us4","zone-vultr-nrt-cluster-ap2","zone-vultr-sgp-cluster-ap2","zone-gcp-southamerica-east1-a-cluster-sa2","zone-gcp-southamerica-west1-a-cluster-sa2","zone-vultr-syd-cluster-ap2","zone-gcp-us-central1-a-cluster-us5","zone-gcp-us-east1-c-cluster-us4","zone-gcp-us-east4-b-cluster-us4","zone-gcp-us-east5-a-cluster-us4","zone-gcp-us-east5-b-cluster-us3","zone-gcp-us-south1-a-cluster-us4","zone-gcp-us-west1-b-cluster-us5","zone-gcp-us-west2-a-cluster-us5"]
2023-02-01T11:25:15.616Z --- INF Trying to find a server attempt=1 max_latency=15
2023-02-01T11:25:15.622Z --- INF Obtaining a lease cached= endpoint=https://eks-us.workloads.testcontainers.cloud/lease?zone=gcp-us-east1-c index=1
2023-02-01T11:25:15.623Z --- INF Picked server id=zone-gcp-us-east1-c-cluster-us4 index=1 responded=5 server=35.243.131.59
2023-02-01T11:25:15.917Z --- INF Unable to obtain a lease body="{\"title\":\"Too many leases active on cluster for user\",\"status\":429}" status=429
ERROR: too many concurrent leases
11:25:16.188 [main] INFO  org.testcontainers.dockerclient.DockerMachineClientProviderStrategy - docker-machine executable was not found on PATH ([/usr/java/openjdk-17/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin])
11:25:16.192 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
    EnvironmentAndSystemPropertyClientProviderStrategy: failed with exception InternalServerErrorException (Status 500: Failed to get a lease: too many concurrent leases
)
    UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Could not find unix domain socket). Root cause NoSuchFileException (/var/run/docker.sock)As no valid configuration was found, execution cannot continue.
See https://www.testcontainers.org/on_failure.html for more details.
11:25:17.195 [main] ERROR com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Exception during pool initialization.
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
    at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$7(DockerClientProviderStrategy.java:256)
    at java.base/java.util.Optional.orElseThrow(Optional.java:403)
    at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:247)
    at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:150)
    at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:186)
    at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104)
    at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:108)
    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)
    at org.testcontainers.jdbc.ContainerDatabaseDriver.connect(ContainerDatabaseDriver.java:124)
    at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
    at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)
    at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
    at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100)
    at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
    at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:284)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:177)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:36)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:255)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:230)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207)
    at org.hibernate.boot.model.relational.Database.<init>(Database.java:44)
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:218)
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:191)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:138)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1350)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1421)
    at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:66)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
    at org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:137)
    at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:59)
    at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:47)
    at org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1386)
    at org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:543)
    at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:137)
    at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:108)
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:184)
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:118)
    at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:127)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:141)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:97)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:241)
    at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:377)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:382)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:377)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
    at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
    at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:376)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:289)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:288)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:278)
    at java.base/java.util.Optional.orElseGet(Optional.java:364)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:277)
    at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:105)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:104)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:68)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
    at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
    at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
    at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
11:25:17.206 [main] WARN  org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator - HHH000342: Could not obtain connection to query metadata
com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Could not find a valid Docker environment. Please see logs and check configuration
    at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:596)
    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:582)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100)
    at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
    at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:284)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:177)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:36)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:255)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:230)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207)
    at org.hibernate.boot.model.relational.Database.<init>(Database.java:44)
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:218)
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:191)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:138)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1350)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1421)
    at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:66)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
    at org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:137)
    at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:59)
    at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:47)
    at org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1386)
    at org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:543)
    at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:137)
    at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:108)
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:184)
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:118)
    at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:127)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:141)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:97)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:241)
    at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:377)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:382)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:377)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
    at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
    at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:376)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:289)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:288)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:278)
    at java.base/java.util.Optional.orElseGet(Optional.java:364)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:277)
    at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:105)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:104)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:68)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
    at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
    at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
    at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
    at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$7(DockerClientProviderStrategy.java:256)
    at java.base/java.util.Optional.orElseThrow(Optional.java:403)
    at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:247)
    at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:150)
    at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:186)
    at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104)
    at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:108)
    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)
    at org.testcontainers.jdbc.ContainerDatabaseDriver.connect(ContainerDatabaseDriver.java:124)
    at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
    at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)
    at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
    at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
    ... 111 common frames omitted
11:25:17.219 [main] ERROR org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
(...)
andreas-11 commented 1 year ago

Hi all, did you have any luck with the above? We are facing the same issue when trying to run our TestContainers on GitlabCI using dind.

lrkwz commented 1 year ago

Hi all, did you have any luck with the above? We are facing the same issue when trying to run our TestContainers on GitlabCI using dind.

Yes it is working now, my .gitlab-ci.yml is

variables:
  # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
  MAVEN_OPTS: >-
    -Dhttps.protocols=TLSv1.2
    -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository
    -Dorg.slf4j.simpleLogger.showDateTime=true
    -Djava.awt.headless=true

  # As of Maven 3.3.0 instead of this you MAY define these options in `.mvn/maven.config` so the same config is used
  # when running from the command line.
  # As of Maven 3.6.1, the use of `--no-tranfer-progress` (or `-ntp`) suppresses download and upload messages. The use
  # of the `Slf4jMavenTransferListener` is no longer necessary.
  # `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
  MAVEN_CLI_OPTS: >-
    --batch-mode
    --errors
    --fail-at-end
    --show-version
    --no-transfer-progress
    -DinstallAtEnd=true
    -DdeployAtEnd=true

  TC_CLOUD_TOKEN: ***********************************************

# This template uses the latest Maven 3 release, e.g., 3.8.6, and OpenJDK 17 (LTS)
# for verifying and deploying images
# Maven 3.8.x REQUIRES HTTPS repositories.
# See https://maven.apache.org/docs/3.8.1/release-notes.html#how-to-fix-when-i-get-a-http-repository-blocked for more.
image: maven:3-openjdk-17

# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
# Be aware that `mvn deploy` will install the built jar into this repository. If you notice your cache size
# increasing, consider adding `-Dmaven.install.skip=true` to `MAVEN_OPTS` or in `.mvn/maven.config`
cache:
  paths:
    - .m2/repository

# For merge requests do not `deploy` but only run `verify`.
# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
.verify:
  stage: test
  script:
    - curl -fsSL https://app.testcontainers.cloud/bash | bash
    - 'mvn $MAVEN_CLI_OPTS verify'
  except:
    variables:
      - $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

# Verify merge requests using JDK17
verify:jdk17:
  extends:
    - .verify

# To deploy packages from CI, create a `ci_settings.xml` file
# For deploying packages to GitLab's Maven Repository: See https://docs.gitlab.com/ee/user/packages/maven_repository/index.html#create-maven-packages-with-gitlab-cicd for more details.
# Please note: The GitLab Maven Repository is currently only available in GitLab Premium / Ultimate.
# For `master` or `main` branch run `mvn deploy` automatically.
deploy:jdk17:
  stage: deploy
  script:
    - if [ ! -f ci_settings.xml ]; then
      echo "CI settings missing\! If deploying to GitLab Maven Repository, please see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html#create-maven-packages-with-gitlab-cicd for instructions.";
      fi
    - curl -fsSL https://app.testcontainers.cloud/bash | bash
    - 'mvn $MAVEN_CLI_OPTS deploy --settings ci_settings.xml'
  only:
    variables:
      - $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

You should replace TC_CLOUD_TOKEN with yours of course

andreas-11 commented 1 year ago

Thanks @lrkwz. So I notice that you have switched to TestContainers Cloud, instead of running TestContainers on Gitlab, which was attempted by the first .gitlab-ci.yml, right?

danielcmas commented 1 year ago

I'm getting the exact same issue trying to run docker dind in gitlab

lrkwz commented 1 year ago

Thanks @lrkwz. So I notice that you have switched to TestContainers Cloud, instead of running TestContainers on Gitlab, which was attempted by the first .gitlab-ci.yml, right?

right

eddumelendez commented 1 year ago

Closing due to it has been solved. For further reference check the docs and the blog post