首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TestContainers框架无法到达码头管理员

TestContainers框架无法到达码头管理员
EN

Stack Overflow用户
提问于 2020-11-23 00:27:45
回答 1查看 3.1K关注 0票数 2

我试图让测试容器构建一个mariadb实例,如下所示:

代码语言:javascript
复制
connection = DriverManager.getConnection("jdbc:tc:mariadb:5.6.23:///datavault");

但我得到的是这个日志:

代码语言:javascript
复制
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提供的ubuntu存储库中的码头默认安装

假设测试容器无法读取/var/run/docker.sock文件,

我把我的用户添加到了码头组,但是错误是一样的!

此外,我尝试了Quickstart示例,但仍然得到同样的错误!

非常感谢你的帮助,

如果你需要更多的信息,请告诉我!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-23 22:33:42

有时候这很容易:

加入码头集团是正确的主意。

但我忘了的是,加入一个团队

只有在新登录用户后才会接管!

代码语言:javascript
复制
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

在那之后,我得到一个新的错误,但这是另一个主题。

对不起,烦人了!

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64961135

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档