我尝试让testcontainers构建一个mariadb示例,如下所示:
connection = DriverManager.getConnection("jdbc:tc:mariadb:5.6.23:///datavault");
但我得到的是这个日志:
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:
...
我使用的默认安装是docker-it self提供的ubuntu存储库中的docker。
假设testcontainers无法读取/var/run/docker.sock文件,
我将我的用户添加到docker组,但错误是相同的!
另外,我尝试了快速启动的例子,但仍然得到相同的错误!
非常感谢你的帮助,
如果你需要更多的信息,请告诉我!
1条答案
按热度按时间nwo49xxi1#
有时候很简单:
加入docker group是正确的想法
但我忘了一个事实
只有在新用户登录后才被接管!
之后,我得到一个新的错误,但这是另一个主题。
抱歉打扰了!