【问题标题】:Test container error when starting docker from macbook m1从 macbook m1 启动 docker 时测试容器错误
【发布时间】:2021-07-31 12:20:51
【问题描述】:

我使用的是 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 无法运行?如何运行它

【问题讨论】:

    标签: docker docker-machine apple-m1 testcontainers


    【解决方案1】:

    试试Docker for Mac

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

    【讨论】:

    • 我使用 docker for mac 但是当我开始项目时我需要 Docker machine "" .
    • @BaoTrungTran 您的主目录中有一个隐藏文件 .testcontainers.properties。可以发一下内容吗?
    • 谢谢你,它现在可以工作了,但是当我通过 testContainer 启动它时,它会抛出异常:原因:com.github.dockerjava.api.exception.DockerClientException:无法拉取图像:linux 没有匹配的清单清单列表条目中的 /arm64/v8
    猜你喜欢
    • 2023-02-11
    • 2017-01-07
    • 2021-12-16
    • 1970-01-01
    • 1970-01-01
    • 2021-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多