我已按照官方网站中的说明将 docker 与 WSL 2 结合使用,并安装了 Ubuntu 18.04 for WSL 2 发行版。我认为 docker 可以自动检测我的发行版,因此我可以选择在我的 docker 桌面中使用哪个发行版。我一直在搜索这个问题,但仍然没有得到解决方案。请帮忙,谢谢。
这是 WSL 集成页面,我已将 ubuntu 18.04 设置为默认值,但仍然没有成功。

这是我拥有的 wsl 2 发行版列表
因此,我无法访问 docker 容器,它说
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
Run Code Online (Sandbox Code Playgroud) windows docker windows-subsystem-for-linux ubuntu-18.04 wsl-2
我不明白协程构造函数的语法。
private val uiScope = CoroutineScope(Dispatchers.Main + viewModelJob)
Run Code Online (Sandbox Code Playgroud)
我知道参数需要 Coroutine Context 类。我不明白的是我们如何添加 2 个不同的对象?Dispatchers.Main 类是 MainCoroutineDispatcher,viewModelJob 类是 Job。有什么解释吗?
目前,我想为我的系统创建集成测试。我使用 testcontainers 生成临时数据库实例,并使用 R2DBC 数据库使我的系统具有反应性。问题是我不知道如何在 R2DBC testcontainer 实例中创建模式,testcontainers 网页中的R2DBC 支持和JDBC支持之间的文档存在明显差异。在 JDBC 中,在替换 JDBC URL 后有创建 schema 的部分,而在 R2DBC 中,在替换 R2DBC URL 后没有提及创建 schema。我已经尝试和探索了中的方法PostgreSQLR2DBCDatabaseContainer,但没有成功。
我还使用 spring boot 作为我们系统的框架,通常我使用初始值设定项替换 URL ContextConfiguration。替换 R2DBC 的 URL 后有什么方法可以创建架构吗?
postgresql integration-testing spring-boot testcontainers r2dbc
docker ×1
kotlin ×1
postgresql ×1
r2dbc ×1
spring-boot ×1
ubuntu-18.04 ×1
windows ×1
windows-subsystem-for-linux ×1
wsl-2 ×1