testcontainers-node: TLS config is not detected resulting in error
We run testcontainers in GitLab CI and configured docker dind with TLS verification which is enabled by default in docker since docker 19.03.12. We have setup the runner correctly, so the tls certificats are available and environment variables are set. docker version in the CI works correctly and can connect to dind via tls connection. However, testcontainer fails to run the tests with the following Debug log:
2021-12-22T18:43:24.335Z testcontainers DEBUG Found applicable Docker client strategy: ConfigurationStrategy
2021-12-22T18:43:24.336Z testcontainers DEBUG Testing Docker client strategy URI: tcp://docker:2376
2021-12-22T18:43:24.423Z testcontainers WARN Docker daemon is not reachable: Error: error:0480006C:PEM routines::no start line
2021-12-22T18:43:24.424Z testcontainers WARN Docker client strategy ConfigurationStrategy is not reachable
2021-12-22T18:43:24.424Z testcontainers DEBUG Found applicable Docker client strategy: UnixSocketStrategy
2021-12-22T18:43:24.425Z testcontainers DEBUG Testing Docker client strategy URI: unix:///var/run/docker.sock
I seems testcontainer tries to connect to the docker daemon without tls using the tls port.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15
The certificates are automatically generated by docker:dind see https://hub.docker.com/_/docker/#tls “Starting in 18.09+, the dind variants of this image will automatically generate TLS certificates in the directory specified by the DOCKER_TLS_CERTDIR environment variable.”