I am adding Testcontainers to my integration tests. Locally everything works fine. To let it run on my Bitbucket Pipelines, I created following (simplified) bitbucket-pipeline.yml:
image: maven:3.6.1
pipelines:
default:
- step:
caches:
- maven
script:
- export TESTCONTAINERS_RYUK_DISABLED=true
- mvn -B verify
branches:
master:
- step:
caches:
- maven
services:
- docker
script:
- ..
definitions:
services:
docker:
memory: 2048
But when the pipeline starts running and the tests are executed, the docker service seems non existent:
Container startup failed
org.testcontainers.containers.ContainerLaunchException: Container startup failed
Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=postgres:12.4, imagePullPolicy=DefaultPullPolicy())
Caused by: java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration