Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/390.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java TestContainers框架可以';达不到码头执事_Java_Docker_Junit_Mariadb_Testcontainers - Fatal编程技术网

Java TestContainers框架可以';达不到码头执事

Java TestContainers框架可以';达不到码头执事,java,docker,junit,mariadb,testcontainers,Java,Docker,Junit,Mariadb,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

我正在尝试按如下方式构建一个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:
...
我正在使用。
假设testcontainers无法读取/var/run/docker.sock文件,
我将我的用户添加到docker组,但错误相同

此外,我尝试了,但仍然得到相同的错误

非常感谢您的帮助,

如果您需要更多信息,请告诉我

有时候这很容易:
加入docker group是正确的想法
但我忘记了一个事实,那就是加入一个团队
只有在新用户登录后才被接管

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
在此之后,我得到一个新的错误,但这是另一个主题。
抱歉打扰了