Reputation: 41
I'm trying to let testcontainers build a mariadb instance as follows:
connection = DriverManager.getConnection("jdbc:tc:mariadb:5.6.23:///datavault");
But what I get is this log:
01:03:00.438 [main] DEBUG o.t.jdbc.ContainerDatabaseDriver - Container not found in cache, creating new instance
01:03:00.540 [main] DEBUG o.t.u.TestcontainersConfiguration - Testcontainers configuration overrides will be loaded from file:/home/tobias/.testcontainers.properties
01:03:00.545 [main] INFO o.t.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (ConfigurationFileImageNameSubstitutor)
01:03:00.559 [main] DEBUG o.t.utility.ImageNameSubstitutor - Did not find a substitute image for mariadb:5.6.23 (using image substitutor: DefaultImageNameSubstitutor (ConfigurationFileImageNameSubstitutor))
01:03:00.612 [main] INFO o.t.d.DockerMachineClientProviderStrategy - docker-machine executable was not found on PATH ([/usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /snap/bin])
01:03:00.612 [main] DEBUG o.t.d.RootlessDockerClientProviderStrategy - $XDG_RUNTIME_DIR is set but '/run/user/1000/snap.intellij-idea-community/docker.sock' does not exist.
01:03:00.613 [main] DEBUG o.t.d.RootlessDockerClientProviderStrategy - '/home/tobias/.docker/run' does not exist.
01:03:00.708 [main] DEBUG o.t.d.RootlessDockerClientProviderStrategy - '/run/user/1000/docker.sock' does not exist.
01:03:01.277 [ducttape-0] DEBUG o.t.d.DockerClientProviderStrategy - Pinging docker daemon...
01:03:01.299 [ducttape-0] DEBUG o.t.s.c.g.d.c.command.AbstrDockerCmd - Cmd:
01:03:01.428 [ducttape-0] DEBUG o.t.d.DockerClientProviderStrategy - Pinging docker daemon...
01:03:01.428 [ducttape-0] DEBUG o.t.s.c.g.d.c.command.AbstrDockerCmd - Cmd:
01:03:01.530 [ducttape-0] DEBUG o.t.d.DockerClientProviderStrategy - Pinging docker daemon...
01:03:01.530 [ducttape-0] DEBUG o.t.s.c.g.d.c.command.AbstrDockerCmd - Cmd:
01:03:01.633 [ducttape-0] DEBUG o.t.d.DockerClientProviderStrategy - Pinging docker daemon...
01:03:01.633 [ducttape-0] DEBUG o.t.s.c.g.d.c.command.AbstrDockerCmd - Cmd:
...
I'm using the default installation of docker from the ubuntu repository provided by docker it self.
Assuming testcontainers isn't able to read the /var/run/docker.sock file,
I added my user to the docker group, but the error is the same!
Additionaly I tried the Quickstart example but get still the same error!
Many thanks for your help,
let me know if you need further informations!
Upvotes: 2
Views: 4579
Reputation: 41
Sometimes it can be so easy:
Adding to docker group was the right idea
but what I forgot is the fact that adding to a group
is only taken over after new login the user!
23:18:04.457 [ducttape-0] DEBUG o.t.d.DockerClientProviderStrategy - Pinging docker daemon...
23:18:04.483 [ducttape-0] DEBUG o.t.s.c.g.d.c.command.AbstrDockerCmd - Cmd:
23:18:04.720 [main] INFO o.t.d.DockerClientProviderStrategy - Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
23:18:04.721 [main] DEBUG o.t.d.DockerClientProviderStrategy - Transport type: 'okhttp', Docker host: 'unix:///var/run/docker.sock'
23:18:04.721 [main] DEBUG o.t.d.DockerClientProviderStrategy - Checking Docker OS type for local Unix socket (unix:///var/run/docker.sock)
23:18:04.722 [main] INFO o.testcontainers.DockerClientFactory - Docker host IP address is localhost
23:18:04.723 [main] DEBUG o.t.s.c.g.d.c.command.AbstrDockerCmd - Cmd:
23:18:04.742 [main] DEBUG o.t.s.c.g.d.c.command.AbstrDockerCmd - Cmd:
23:18:04.757 [main] INFO o.testcontainers.DockerClientFactory - Connected to docker:
Server Version: 19.03.13
API Version: 1.40
Operating System: Ubuntu 18.04.5 LTS
Total Memory: 7894 MB
After that I get a new error but this is another topic.
Sorry for annoying!
Upvotes: 2