从 macbook m1

时间:2021-05-10 04:04:29

标签: docker docker-machine apple-m1 testcontainers

我使用的是 macbook m1,但在使用来自 docker 的测试容器时出现错误。当我使用 docker 启动项目时,它会抛出错误

Docker machine "" does not exist

我使用命令安装 virtualbox:brew install virtualbox --cask

当我安装成功并启动它时抛出异常:

(default) Check network to re-create if needed...
(default) Creating a new host-only adapter produced an error: /usr/local/bin/VBoxManage hostonlyif create failed:
(default) 0%...
(default) Progress state: NS_ERROR_FAILURE
(default) VBoxManage: error: Failed to create the host-only adapter
(default) VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
(default) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
(default) VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 95 of file VBoxManageHostonly.cpp
(default) 
(default) This is a known VirtualBox bug. Let's try to recover anyway...
Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug.

现在我无法运行 testContainer,因为它需要 Docker 机器。我无法启动,因为 VirtualBox 无法运行?如何运行它

1 个答案:

答案 0 :(得分:2)

试试Docker for Mac

另外,请确保您使用的是最新版本的 Testcontainers,并且您的 JNA 依赖项是 5.7.0 或更高版本。