redroid-doc icon indicating copy to clipboard operation
redroid-doc copied to clipboard

host.docker.internal not resolving

Open Dialgatrainer02 opened this issue 9 months ago • 3 comments

Describe the bug 请详细描述问题(ZH_CN) A clear and concise description of what the bug is. when using redroid as a local dev emulator. using extra_hosts to connect to the hosts localhost doesnt resolve

make sure the required kernel modules present 确保必须的内核功能已开启(ZH_CN)

  • [x] grep binder /proc/filesystems
  • [ ] grep ashmem /proc/misc (optional)

Collect debug logs 收集调试日志(ZH_CN)

[CONTAINER]` omit CONTAINER if not exist any more. 如容器已退出,可忽略CONTAINER参数(ZH_CN)

name: redroid
services:
    redroid:
        stdin_open: true
        tty: true
        privileged: true
        ports:
          - 5555:5555
        pull_policy: always
        volumes:
            - ~/data:/data
        image: redroid/redroid:12.0.0_64only-latest
        command: ro.secure=0 androidboot.redroid_gpu_mode=auto
        extra_hosts:
          - "host.docker.internal:host-gateway"

host os: arch linux docker -v Docker version 28.0.4, build b8034c0ed7

Screenshots 截图(ZH_CN) If applicable, add screenshots to help explain your problem.

Image

Dialgatrainer02 avatar Apr 09 '25 09:04 Dialgatrainer02

我也遇到了,安卓容器,或者至少基于类似 redroid 的安卓容器,都有这个问题。而且这个问题还不仅是 extra_hosts。你通过 service 的名字访问其他容器也是无法解析的,进而不能路由,不知道安卓搞了什么东西。

madobet avatar Jul 26 '25 14:07 madobet

i got same problem too, cannot connect with host machine

MoaMoa90 avatar Jul 30 '25 18:07 MoaMoa90