我试图在多阶段构建Dockerfile中使用Testcontainers,目前它在以下方面失败:
ERROR --- [ main] o.t.d.DockerClientProviderStrategy : Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
ERROR --- [ main] o.t.d.DockerClientProviderStrategy : UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Could not find unix domain socket). Root cause NoSuchFileException (/var/run/docker.sock)
ERROR --- [ main] o.t.d.DockerClientProviderStrategy : As no valid configuration was found, execution cannot continue是否有一种方法可以在多级构建中挂载/var/run/docker.sock?或者,除了必须挂载docker.sock之外,还有其他选择吗?
发布于 2022-08-22 06:49:32
据我所知,在当前时间点上访问Docker (特别是/var/run/docker.sock主机的Docker套接字)是不可能的。但是,您可以将Docker构建配置为通过网络访问守护进程,如this应答中所述。
https://stackoverflow.com/questions/73397694
复制相似问题