Testcontainers-java: Gitlab CI example doesn't work.

Created on 10 May 2020  路  1Comment  路  Source: testcontainers/testcontainers-java

Hello,
the example doesn't work.

stages:
  - test

# DinD service is required for Testcontainers
services:
  - docker:dind

variables:
  # Instruct Testcontainers to use the daemon of DinD.
  DOCKER_HOST: "tcp://docker:2375"
  # Improve performance with overlayfs.
  DOCKER_DRIVER: overlay2

test:
 image: gradle:6.3
 stage: test
 script: gradle test
 Running with gitlab-runner 12.5.0 (577f813d)
   on docker_runner Ty_Z-Ji3
Using Docker executor with image gradle:6.3 ...
 Starting service docker:dind ...
 Pulling docker image docker:dind ...
 Using docker image sha256:c814ba3a41a3de0a9a23b7d0bb36f64257b12aef5103b4ce1d5f1bfc3033aad3 for docker:dind ...
 Waiting for services to be up and running...
 Pulling docker image gradle:6.3 ...
 Using docker image sha256:6bbd9a5d91a761210f1db018858748fac367fa6fc7321955ea3277cc20073306 for gradle:6.3 ...
Running on runner-Ty_Z-Ji3-project-44-concurrent-0 via 3a915fa5e232...
00:03
Fetching changes with git depth set to 50...
00:02
[...]
 Skipping Git submodules setup
$ gradle test
 Welcome to Gradle 6.3!
 Here are the highlights of this release:
  - Java 14 support
  - Improved error messages for unexpected failures
 For more details see https://docs.gradle.org/6.3/release-notes.html
 To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.3/userguide/gradle_daemon.html.
 Daemon will be stopped at the end of the build stopping after processing
 > Task :compileKotlin
 > Task :compileJava NO-SOURCE
 > Task :processResources
 > Task :classes
 > Task :compileTestKotlin
 > Task :compileTestJava NO-SOURCE
 > Task :processTestResources
 > Task :testClasses
 > Task :test
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:163
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 [...] > [...]() FAILED
     java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
         Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:320
             Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1268
                 Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:83
 13 tests completed, 12 failed
 > Task :test FAILED
 FAILURE: Build failed with an exception.
 * What went wrong:
 Execution failed for task ':test'.
 > There were failing tests. See the report at: [...]
 * Try:
 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
 * Get more help at https://help.gradle.org
 BUILD FAILED in 1m 10s
 5 actionable tasks: 5 executed
 ERROR: Job failed: exit code 1

Gitlab Runner:

concurrent = 6

[[runners]]
  name = "docker_runner"
  url = "[...]"
  token = "[...]"
  executor = "docker"
  builds_dir = ""
  [runners.docker]
    host = ""
    image = "busybox:1:31.0"
    privileged = true
    disable_cache = false
    volumes = ["/cache"]
  [runners.cache]
    Insecure = false

Most helpful comment

To whoever is searching for this, you just have to add an environment variable:

variables:
  DOCKER_TLS_CERTDIR: ""

>All comments

To whoever is searching for this, you just have to add an environment variable:

variables:
  DOCKER_TLS_CERTDIR: ""
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rnorth picture rnorth  路  3Comments

richard77 picture richard77  路  3Comments

chomhanks picture chomhanks  路  3Comments

lovepoem picture lovepoem  路  3Comments

michael-simons picture michael-simons  路  3Comments