I have java project which using testcontainers for integration test. I want to implement gitlab ci for that stage but I've got that error
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
The project build successfully on local machine but gitlap ci docker couldn't start propeply
Here a log output
[0KRunning with gitlab-runner 14.3.0 (b37d3da9)[0;m
[0K on Backend Docker runner 9L3Zko1w[0;m
section_start:1657698628:prepare_executor
[0K[0K[36;1mPreparing the "docker" executor[0;m[0;m
[0KUsing Docker executor with image maven:3.6.0-jdk-11-slim ...[0;m
[0KStarting service docker:dind ...[0;m
[0KPulling docker image docker:dind ...[0;m
[0KUsing docker image sha256:232342342342 for docker:dind with digest docker@sha256:2342342342 ...[0;m
[0KWaiting for services to be up and running...[0;m
[0;33m*** WARNING:[0;m Service runner-23423423-docker-0 probably didn't start properly.
Health check error:
service "runner-234234234-docker-0-wait-for-service" timeout
Health check container logs:
Service container logs:
2022-07-13T07:50:40.800780292Z ip: can't find device 'ip_tables'
2022-07-13T07:50:40.801898214Z ip_tables 32768 2 iptable_filter,iptable_nat
2022-07-13T07:50:40.802546323Z x_tables 45056 5 xt_conntrack,xt_MASQUERADE,xt_addrtype,iptable_filter,ip_tables
2022-07-13T07:50:40.802609399Z modprobe: can't change directory to '/lib/modules': No such file or directory
2022-07-13T07:50:40.806461330Z mount: permission denied (are you root?)
2022-07-13T07:50:40.807019652Z Could not mount /sys/kernel/security.
2022-07-13T07:50:40.807028026Z AppArmor detection and --privileged mode might break.
2022-07-13T07:50:40.807931221Z mount: permission denied (are you root?)
here is gitlab ci yaml
services:
- name: docker:dind
# explicitly disable tls to avoid docker startup interruption
command: ["--tls=false"]
variables:
# Instruct Testcontainers to use the daemon of DinD.
DOCKER_HOST: "tcp://docker:2375"
# Instruct Docker not to start over TLS.
DOCKER_TLS_CERTDIR: ""
# Improve performance with overlayfs.
DOCKER_DRIVER: overlay2
test:
image: maven:3.8.6-jdk-11-slim
stage: ⚙️ maven-build
before_script:
- docker info
- cp $MAVEN_SETTINGS_XML ~/.m2/settings.xml
script:
- mvn $MAVEN_CLI_OPTS clean verify
docker:24.0.6-dind
, i will monitor the build to see if the issue rises again – Inclusive