Understanding How Host File Blocking Interferes with Docker Communication (127.0.0.1 Issue)

Hi there,

I’m working with Docker to build a Flutter app through act-cli, but I’m encountering an issue where Gradle cannot connect to 127.0.0.1 during the build process. Initially, this seemed like a network issue with Docker’s default network configuration.

But then I checked the Gradle log and figured out some endpoint link to the port 127.0.0.1

2024-12-14T05:04:39.937+0000 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonMain] Assuming the daemon was started with following jvm opts: [--add-opens=java.base/java.util=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.lang.invoke=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED, --add-opens=java.base/java.nio.charset=ALL-UNNAMED, --add-opens=java.base/java.net=ALL-UNNAMED, --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED, -Xmx1000m, -Dfile.encoding=UTF-8, -Duser.country=US, -Duser.language=en, -Duser.variant]
2024-12-14T05:04:40.004+0000 [INFO] [org.gradle.launcher.daemon.server.Daemon] start() called on daemon - DefaultDaemonContext[uid=476a22cb-6485-4d7c-a6b1-b142c4c80e15,javaHome=/usr/lib/jvm/java-17-openjdk-amd64,javaVersion=17,javaVendor=Ubuntu,daemonRegistryDir=/root/.gradle/daemon,pid=533,idleTimeout=120000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx1000m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2024-12-14T05:04:40.018+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface docker0
2024-12-14T05:04:40.018+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
2024-12-14T05:04:40.018+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /172.17.0.1
2024-12-14T05:04:40.019+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface br-1ac2cbf1abc1
2024-12-14T05:04:40.019+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
2024-12-14T05:04:40.019+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /172.18.0.1
2024-12-14T05:04:40.019+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface eth0
2024-12-14T05:04:40.019+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
2024-12-14T05:04:40.020+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fdc4:f303:9324:0:0:0:0:3%eth0
2024-12-14T05:04:40.020+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:c91:dfff:fef2:8afa%eth0
2024-12-14T05:04:40.020+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.65.3
2024-12-14T05:04:40.020+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface services1
2024-12-14T05:04:40.020+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
2024-12-14T05:04:40.020+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:309a:5ff:fe7f:5efe%services1
2024-12-14T05:04:40.020+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fdc4:f303:9324:0:0:0:0:6%services1
2024-12-14T05:04:40.020+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.65.6
2024-12-14T05:04:40.021+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface lo
2024-12-14T05:04:40.021+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
2024-12-14T05:04:40.021+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /0:0:0:0:0:0:0:1%lo
2024-12-14T05:04:40.021+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1
2024-12-14T05:04:40.022+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Listening on [f0396ef3-6600-4fa1-9305-cebee6fdd858 port:35595, addresses:[localhost/127.0.0.1]].
2024-12-14T05:04:40.028+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Sat Dec 14 05:04:40 GMT 2024, with address: [f0396ef3-6600-4fa1-9305-cebee6fdd858 port:35595, addresses:[localhost/127.0.0.1]]
2024-12-14T05:04:40.029+0000 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertising the daemon address to the clients: [f0396ef3-6600-4fa1-9305-cebee6fdd858 port:35595, addresses:[localhost/127.0.0.1]]
2024-12-14T05:04:40.029+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=476a22cb-6485-4d7c-a6b1-b142c4c80e15,javaHome=/usr/lib/jvm/java-17-openjdk-amd64,javaVersion=17,javaVendor=Ubuntu,daemonRegistryDir=/root/.gradle/daemon,pid=533,idleTimeout=120000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx1000m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2024-12-14T05:04:40.030+0000 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [f0396ef3-6600-4fa1-9305-cebee6fdd858 port:35595, addresses:[localhost/127.0.0.1]], context: DefaultDaemonContext[uid=476a22cb-6485-4d7c-a6b1-b142c4c80e15,javaHome=/usr/lib/jvm/java-17-openjdk-amd64,javaVersion=17,javaVendor=Ubuntu,daemonRegistryDir=/root/.gradle/daemon,pid=533,idleTimeout=120000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx1000m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
...
(more)

The critical error is that the Gradle daemon couldn’t been connected

What went wrong:
Could not connect to the Gradle daemon.
Daemon uid: 908223a2-5fc1-4129-9952-a4c2edad0ed7 with diagnostics:
Daemon pid: 14720

After a very long trial and errors, with various combination on config I solved the problem by turn-off the network host on Docker Desktop ( I am using Window 10 and Docker Desktop).

Then my intuition suggest me to check the host file (in C:\Windows\System32\drivers\etc)

Looked like I intentionally put two record to block distracting site using 127.0.0.1

127.0.0.1 9gag.com
127.0.0.1 facebook.com

By removing the two lines, the problem had been solved. But I want to study & understand why it happened from the first place.

In summary, here’s the sequence of what happened:

  1. I couldn’t run flutter build because Gradle couldn’t connect to 127.0.0.1.
  2. The problem was resolved when I disabled Docker’s host network mode (--network host).
  3. I then found that the issue was fixed (even on network host) when I removed two blocked entries in my hosts file that were redirecting certain domains to 127.0.0.1.

I want to deeply understand how these blocked lines in the hosts file (redirecting domain names to 127.0.0.1) are interfering with Docker’s networking and communication. Specifically: How does routing 127.0.0.1 for certain domains affect Docker containers and their ability to access services running on the host (like Gradle)?

Any insights on the relationship between Docker’s network stack and the host file would be really helpful!

Edit 12/15/2024
It’s more likely that I was wrong. I tested again with the two line removed and then readded later then it turns out the error STILL HAPPENED. So that mean the only way to fix it is to TURN-OFF the NETWORK HOST. So sorry for the confusion I caused!

The host file can be used to add/override name resolution. It neither blocks anything, nor forwards anything. It does not make any sense that it’s part of the problem, or that removing those lines is part of the solution.

I also agree with you, albeit I still don’t understand why it cause the issue from the first place. That why I ask here.

Btw, here is the .workflow file. The actual code to test could be the Flutter sample project. I just made a sample and run a quick test. The error happened again so I am confident that this bug can be reproduced reliably

name: Bug

on:
  workflow_dispatch:


jobs:
  build:
    name: Build Flutter Project
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/cirruslabs/flutter:3.24.5
    steps:
        - name: Checkout flutter-hello-world
          uses: actions/checkout@v4

        - name: Install Node.js
          run: |
            curl -sL https://deb.nodesource.com/setup_20.x | bash -
            apt-get install -y nodejs
        


        - name: Set up JDK 17
          uses: actions/setup-java@v3
          with:
              java-version: '17'
              distribution: 'temurin'

        - name: Setup Android SDK
          uses: android-actions/setup-android@v3

        - name: Build SampleApplication
          run: flutter build apk --release

I just re-added the line 127.0.0.1 9gag.com and the error occurs again

FAILURE: Build failed with an exception.

* What went wrong:
Could not connect to the Gradle daemon.
Daemon uid: 9e27ccdb-95a8-4e89-b82a-3d2a9ce6ff02 with diagnostics:
Daemon pid: 984
  log file: /root/.gradle/daemon/8.3/daemon-984.out.log
----- Last  20 lines from daemon log file - daemon-984.out.log -----
2024-12-14T12:51:14.335+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fdc4:f303:9324:0:0:0:0:6%services1
2024-12-14T12:51:14.336+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:a4d6:eff:feb8:6f75%services1
2024-12-14T12:51:14.336+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.65.6
2024-12-14T12:51:14.336+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface lo
2024-12-14T12:51:14.336+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
2024-12-14T12:51:14.336+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /0:0:0:0:0:0:0:1%lo
2024-12-14T12:51:14.336+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1
2024-12-14T12:51:14.338+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Listening on [8cb624c8-e7c2-4a8d-97f8-e40ce91adf14 port:43741, addresses:[localhost/127.0.0.1]].
2024-12-14T12:51:14.500+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Sat Dec 14 12:51:14 GMT 2024, with address: [8cb624c8-e7c2-4a8d-97f8-e40ce91adf14 port:43741, addresses:[localhost/127.0.0.1]]
2024-12-14T12:51:14.500+0000 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertising the daemon address to the clients: [8cb624c8-e7c2-4a8d-97f8-e40ce91adf14 port:43741, addresses:[localhost/127.0.0.1]]
2024-12-14T12:51:14.500+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=9e27ccdb-95a8-4e89-b82a-3d2a9ce6ff02,javaHome=/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.13-11/x64,daemonRegistryDir=/root/.gradle/daemon,pid=984,idleTimeout=10800000,priority=NORMAL,applyInstrumentationAgent=true,daemonOpts=-XX:MaxMetaspaceSize=2G,-XX:+HeapDumpOnOutOfMemoryError,--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx4G,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2024-12-14T12:51:14.501+0000 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [8cb624c8-e7c2-4a8d-97f8-e40ce91adf14 port:43741, addresses:[localhost/127.0.0.1]], context: DefaultDaemonContext[uid=9e27ccdb-95a8-4e89-b82a-3d2a9ce6ff02,javaHome=/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.13-11/x64,daemonRegistryDir=/root/.gradle/daemon,pid=984,idleTimeout=10800000,priority=NORMAL,applyInstrumentationAgent=true,daemonOpts=-XX:MaxMetaspaceSize=2G,-XX:+HeapDumpOnOutOfMemoryError,--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx4G,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2024-12-14T12:51:14.507+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2024-12-14T12:51:14.510+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-14T12:51:14.513+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-14T12:51:14.513+0000 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
2024-12-14T12:51:14.513+0000 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
2024-12-14T12:51:14.516+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
2024-12-14T12:51:14.517+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
2024-12-14T12:51:14.517+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
----- End of the daemon log -----


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
| Running Gradle task 'assembleRelease'...                           70.7s
| Gradle task assembleRelease failed with exit code 1

I also added my host file below

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost


127.0.0.1 9gag.com
# Added by Docker Desktop
192.168.100.6 host.docker.internal
192.168.100.6 gateway.docker.internal
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section

# Setup for tailscale VPN ...

I am using VPN service (Tailscale) BUT I already tested its and I am confirm that they are not related to the bug. Turning VPN on/off doesn’t matter to this behavior.

In Dcoker Desktop, there is no real host network. It is just forwarding ports from the host to and from the virtual machine of Docker Desktop. And it seems it also does something with the hosts files.

It also has to do something with the WSL2 backend or just Windows, because I could not reproduce any issue with the host file on my Mac, but I could on Windows. Although I’m not sure which one is the issue. Not being able to reproduce it on macOS, or being able to do it on Windows. The hosts file seems to be used for the name resolution in the containers in Docker Desktop for Windows, but not on Docker Desktop for Mac.

If I add a host to my hosts file on Windows, and try to curl that host pointing to a loopback interface (which would originally be a real website on a public IP), the site is not available. Which could be the expected result when using the host network even though it is not a real one. When I tried the same on macOS, I could always access the website regardless of my hosts file.

Does your Gradle do anything with any of the sites you added to your hosts file? If not, I don’t udnerstand it either. Unless you have an older Docker Desktop which had an additional bug, but any other site works from my Docker Desktop v4.37

One thing I can imagine, if your Gradle daemon (I don’t use it, so I don’t know if it can happen) tries to detect the hosts names assigned to the loopback interface and gets domain names that are not localhost, so it can’t handle it. Why, I don’t know.

HI there,

So sorry for the confusion I caused, I re-tested with the two lines removed, then with and without VPN, with NETWORK_HOST mode set on. The bug still happened.

So yes, as @meyay argued, it’s not related to the HOST file, albeit I will investigate how/why the network host-mode causing issue for Gradle.

I am not sure if you already wrote about which command is executed in which context:

  • PowerShell on the Windows host?
  • Terminal in a WSL2 distribution with enabled wsl integration in Docker Desktop?
  • Inside a container?

I assume you run the command flutter build in a PowerShell Terminal on the host.

The argument --network host only make sense, if the “host network driver” is enabled in Docker Desktop, see: Host network driver | Docker Docs.

Sorry for the confusion I made,

It is flutter build from the .workflow file, so it should run inside the docker container. From my understanding, the act-cli create a container, then run flutter build inside that docker container.

It’s my wrong to say that I disabled Docker’s host network mode by using flag (--network host ). In reality what I did is toggle off the Network Host mode in Docker Desktop, (in Setting → Resources → Network)

A single command without a precise context, isn’t what will help me to get a better understanding of the situation. Please share all relevant details that allow someone not being in your headspace to actually understand what you do, where you do it and how exactly you do it.

Regarding the host network driver: Is it safe to assume that you read the link and know how a container needs to be started to actually work with the host network driver of Docker Desktop?

Totally understood, I also figured out how to reproduce this more easily and keep our head clean from the act, flutter and even Docker Desktop etc.

Let say I start with a simple kotlin project (hello world),

src/main/kotlin/Main.kt // The Hello_world file
build.gradle.kts

Now, I use gradle:jdk21-jammy from https://hub.docker.com/_/gradle to build the kotlin project by following command:

docker run -v "{THE_HELLO_WORLD_FOLDER_PATH}:/home/gradle/project" -w /home/gradle/project gradle:jdk21-jammy gradle build  --stacktrace

Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :
w: file:///home/gradle/project/build.gradle.kts:22:5: 'kotlinOptions(KotlinJvmOptionsDeprecated /* = KotlinJvmOptions */.() -> Unit): Unit' is deprecated. Please migrate to the compilerOptions DSL. More details are here: https://kotl.in/u1r8ln

> Task :checkKotlinGradlePluginConfigurationErrors SKIPPED
> Task :compileKotlin UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :startScripts UP-TO-DATE
> Task :distTar UP-TO-DATE
> Task :distZip UP-TO-DATE
> Task :assemble UP-TO-DATE
> Task :compileTestKotlin NO-SOURCE
> Task :compileTestJava NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test NO-SOURCE
> Task :check UP-TO-DATE
> Task :build UP-TO-DATE

BUILD SUCCESSFUL in 1m
5 actionable tasks: 5 up-to-date

The result is perfectly ok (this time it doesn’t have --network host

But when I run with ‘–network host’

docker run --network host -v "{THE_HELLO_WORLD_FOLDER_PATH}:/home/gradle/project" -w /home/gradle/project gradle:jdk21-jammy gradle build  --stacktrace

Then the following error occur

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Could not connect to the Gradle daemon.
Daemon uid: 36337d87-f0a1-4646-b6e0-ff58a36338b6 with diagnostics:
Daemon pid: 39
  log file: /home/gradle/.gradle/daemon/8.11.1/daemon-39.out.log
----- Last 20 lines from daemon log file - daemon-39.out.log -----
2024-12-16T11:30:34.564+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fdc4:f303:9324:0:0:0:0:6%services1
2024-12-16T11:30:34.564+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:6c2c:a2ff:fefc:6681%services1
2024-12-16T11:30:34.564+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.65.6
2024-12-16T11:30:34.564+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface lo
2024-12-16T11:30:34.565+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
2024-12-16T11:30:34.565+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /0:0:0:0:0:0:0:1%lo
2024-12-16T11:30:34.565+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1
2024-12-16T11:30:34.566+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Listening on [d65411d2-c9c6-457e-a018-70a97b199cbd port:42615, addresses:[localhost/127.0.0.1]].
2024-12-16T11:30:34.574+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Mon Dec 16 11:30:34 UTC 2024, with address: [d65411d2-c9c6-457e-a018-70a97b199cbd port:42615, addresses:[localhost/127.0.0.1]]
2024-12-16T11:30:34.574+0000 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertising the daemon address to the clients: [d65411d2-c9c6-457e-a018-70a97b199cbd port:42615, addresses:[localhost/127.0.0.1]]
2024-12-16T11:30:34.574+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=36337d87-f0a1-4646-b6e0-ff58a36338b6,javaHome=/opt/java/openjdk,javaVersion=21,javaVendor=Eclipse Adoptium,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=39,idleTimeout=10800000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2024-12-16T11:30:34.575+0000 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [d65411d2-c9c6-457e-a018-70a97b199cbd port:42615, addresses:[localhost/127.0.0.1]], context: DefaultDaemonContext[uid=36337d87-f0a1-4646-b6e0-ff58a36338b6,javaHome=/opt/java/openjdk,javaVersion=21,javaVendor=Eclipse Adoptium,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=39,idleTimeout=10800000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2024-12-16T11:30:34.583+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2024-12-16T11:30:34.585+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-16T11:30:34.587+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-16T11:30:34.587+0000 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
2024-12-16T11:30:34.589+0000 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
2024-12-16T11:30:34.593+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
2024-12-16T11:30:34.595+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
2024-12-16T11:30:34.596+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.----- End of the daemon log -----


* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.launcher.daemon.client.DaemonConnectionException: Could not connect to the Gradle daemon.
Daemon uid: 36337d87-f0a1-4646-b6e0-ff58a36338b6 with diagnostics:
Daemon pid: 39
  log file: /home/gradle/.gradle/daemon/8.11.1/daemon-39.out.log
----- Last 20 lines from daemon log file - daemon-39.out.log -----
2024-12-16T11:30:34.564+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fdc4:f303:9324:0:0:0:0:6%services1
2024-12-16T11:30:34.564+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:6c2c:a2ff:fefc:6681%services1
2024-12-16T11:30:34.564+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.65.6
2024-12-16T11:30:34.564+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface lo
2024-12-16T11:30:34.565+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
2024-12-16T11:30:34.565+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /0:0:0:0:0:0:0:1%lo
2024-12-16T11:30:34.565+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1
2024-12-16T11:30:34.566+0000 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Listening on [d65411d2-c9c6-457e-a018-70a97b199cbd port:42615, addresses:[localhost/127.0.0.1]].
2024-12-16T11:30:34.574+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Mon Dec 16 11:30:34 UTC 2024, with address: [d65411d2-c9c6-457e-a018-70a97b199cbd port:42615, addresses:[localhost/127.0.0.1]]
2024-12-16T11:30:34.574+0000 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertising the daemon address to the clients: [d65411d2-c9c6-457e-a018-70a97b199cbd port:42615, addresses:[localhost/127.0.0.1]]
2024-12-16T11:30:34.574+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=36337d87-f0a1-4646-b6e0-ff58a36338b6,javaHome=/opt/java/openjdk,javaVersion=21,javaVendor=Eclipse Adoptium,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=39,idleTimeout=10800000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2024-12-16T11:30:34.575+0000 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [d65411d2-c9c6-457e-a018-70a97b199cbd port:42615, addresses:[localhost/127.0.0.1]], context: DefaultDaemonContext[uid=36337d87-f0a1-4646-b6e0-ff58a36338b6,javaHome=/opt/java/openjdk,javaVersion=21,javaVendor=Eclipse Adoptium,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=39,idleTimeout=10800000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2024-12-16T11:30:34.583+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2024-12-16T11:30:34.585+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-16T11:30:34.587+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-16T11:30:34.587+0000 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
2024-12-16T11:30:34.589+0000 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
2024-12-16T11:30:34.593+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
2024-12-16T11:30:34.595+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
2024-12-16T11:30:34.596+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.----- End of the daemon log -----

        at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connectToDaemonWithId(DefaultDaemonConnector.java:256)
        at org.gradle.launcher.daemon.client.DefaultDaemonConnector.doStartDaemon(DefaultDaemonConnector.java:221)
        at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(DefaultDaemonConnector.java:210)
        at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:169)
        at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:97)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:56)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:167)
        at org.gradle.launcher.cli.DefaultCommandLineActionFactory$ParseAndBuildAction.execute(DefaultCommandLineActionFactory.java:370)
        at org.gradle.launcher.cli.DefaultCommandLineActionFactory$ParseAndBuildAction.execute(DefaultCommandLineActionFactory.java:334)
        at org.gradle.launcher.cli.DebugLoggerWarningAction.execute(DebugLoggerWarningAction.java:74)
        at org.gradle.launcher.cli.DebugLoggerWarningAction.execute(DebugLoggerWarningAction.java:30)
        at org.gradle.launcher.cli.WelcomeMessageAction.execute(WelcomeMessageAction.java:97)
        at org.gradle.launcher.cli.WelcomeMessageAction.execute(WelcomeMessageAction.java:40)
        at org.gradle.launcher.cli.NativeServicesInitializingAction.execute(NativeServicesInitializingAction.java:50)
        at org.gradle.launcher.cli.NativeServicesInitializingAction.execute(NativeServicesInitializingAction.java:27)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:41)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:26)
        at org.gradle.launcher.cli.DefaultCommandLineActionFactory$WithLogging.execute(DefaultCommandLineActionFactory.java:482)
        at org.gradle.launcher.Main.doAction(Main.java:35)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:52)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:72)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:39)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:31)
Caused by: org.gradle.internal.remote.internal.ConnectException: Could not connect to server [d65411d2-c9c6-457e-a018-70a97b199cbd port:42615, addresses:[/127.0.0.1]]. Tried addresses: [/127.0.0.1].
        at org.gradle.internal.remote.internal.inet.TcpOutgoingConnector.connect(TcpOutgoingConnector.java:67)
        at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connectToDaemon(DefaultDaemonConnector.java:268)
        at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connectToDaemonWithId(DefaultDaemonConnector.java:254)
        ... 24 more
Caused by: java.net.ConnectException: Connection refused
        at java.base/sun.nio.ch.Net.pollConnect(Native Method)
        at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
        at java.base/sun.nio.ch.SocketChannelImpl.finishTimedConnect(SocketChannelImpl.java:1198)
        at java.base/sun.nio.ch.SocketChannelImpl.blockingConnect(SocketChannelImpl.java:1233)
        at java.base/sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:102)
        at org.gradle.internal.remote.internal.inet.TcpOutgoingConnector.tryConnect(TcpOutgoingConnector.java:81)
        at org.gradle.internal.remote.internal.inet.TcpOutgoingConnector.connect(TcpOutgoingConnector.java:54)
        ... 26 more

Extra Context

  • OS: Window 10
  • Docker version 27.4.0, build bde2b89

The build.gradle.kts inside the test folder (the hello world project) looked like

plugins {
    kotlin("jvm") version "2.0.0"
    application
}

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

dependencies {
    testImplementation(kotlin("test"))
}

application {
    mainClass.set("MainKt")
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
    kotlinOptions {
        jvmTarget = "21"
    }
}

tasks.jar {
    manifest {
        attributes["Main-Class"] = "MainKt"
    }
    from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
}

Some actions …

  • I tested the run with firewall & vpn off so I am sure that they are not problematic,
  • I am confident that localhost (127.0.0.1) is working fine in my host computer. I ping to it from the container and from the host itself normally.

Are these context more informative for you this time? Do you think I should refine the problem better? Let me know if you need more info!

Cheer

Yep, this time the picture is clear.

In both scenarios, the commands are executed inside a container:

  • bridge network: gradle daemon is reachable by consumer within the same container using the network interfaces of the container.
  • host network: gradle daemon is not reachable by consumer within the same container using the network interfaces of the wsl2 utility vm.

Since the daemon process and the consuming process run in the same container, I am surprised that it even makes a difference.

In no scenario, the traffic should leave the wsl2 utility vm, so that neither the host firewall, nor a vpn connection on the host should interfere. Also, no host localhost to container localhost communication should be required - but i might be wrong if the Docker Desktop host network driver is enabled.

According to the logs of the 2nd scenario, localhost:42615 successfully was bound on the network interface of the utility vm. Still, I have no idea why the consumer connection was refused.

Here is my guess. Although @meyay is right, and normally an internal communication in a container should work with the host network, the host network normally means you have an actual host network, meaning you have no network isolation at all. In that case there is no magic, it is just the lack of isolation.

With the “fake host network” in Docker Desktop it is not the lack of isolation, but “magic happens” to forward ports between the host and the VM. There are limitations and not all porotocols are supported.

  • The host network feature of Docker Desktop works on layer 4. This means that unlike with Docker on Linux, network protocols that operate below TCP or UDP are not supported.

I guess it is not the case, but it also says

  • Processes inside the container cannot bind to the IP addresses of the host because the container has no direct access to the interfaces of the host.

But the fact that a process cannot listen on a port on the actual host doesn’t mean that trying to access a port on localhost will not try it on the actual host where it is not listening.

But I’m a little confused. Tried to read the beginning of the topic, but it is not clear to me why using the host network is required when all the communications are happening in the container. What is that you want to access on the host from the container?

I have to admit that in my end I dropped using host network since I found the workaround by using bridge network (by turning off host network in Docker Desktop → Setting → Resources → Network → Untick the “Enable host networking”). The reason for the concern is purely driven by curiosity :sweat_smile: I don’t understand why “host network” cannot be used and the underlying mechanism of it so I asked the question here.

I tried host networking on macOS again and I was clearly wrong when I assumed the process would not be able available from the host. I misinterpreted the documentation. It just says the process cannot bind to the host IP, which is obvious as it is in a virtual machine. But Docker Desktop still makes it available from the host. so regrdless of where the traffic is routed when using “localhost”, it should work and it works for me if I use a simple http server for example from a python image. Can you try this too to identify if the issue is related to gradle somehow or general in your environment?

docker run -d --name python-server --net host python:3 python3 -m http.server --bind 127.0.0.1 8888 
docker exec -it python-server bash
curl localhost:8888
1 Like

Hi there, me again!

I think the curl worked perfectly well Here is the below log:

(log from pulling image)

Digest: sha256:9255d1993f6d28b8a1cd611b108adbdfa38cb7ccc46ddde8ea7d734b6c845e32
Status: Downloaded newer image for python:3
0b9f40b22086f2806869f9d463f124c5c8cc6537b7130a6b6e7a902c1a83c4ae

PS C:\Users\USERNAME> docker exec -it python-server bash
root@docker-desktop:/# curl localhost:8888
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Directory listing for /</title>
</head>
<body>
<h1>Directory listing for /</h1>
<hr>
<ul>
<li><a href=".dockerenv">.dockerenv</a></li>
<li><a href="bin/">bin@</a></li>
<li><a href="boot/">boot/</a></li>
<li><a href="dev/">dev/</a></li>
<li><a href="etc/">etc/</a></li>
<li><a href="home/">home/</a></li>
<li><a href="lib/">lib@</a></li>
<li><a href="lib64/">lib64@</a></li>
<li><a href="media/">media/</a></li>
<li><a href="mnt/">mnt/</a></li>
<li><a href="opt/">opt/</a></li>
<li><a href="proc/">proc/</a></li>
<li><a href="root/">root/</a></li>
<li><a href="run/">run/</a></li>
<li><a href="sbin/">sbin@</a></li>
<li><a href="srv/">srv/</a></li>
<li><a href="sys/">sys/</a></li>
<li><a href="tmp/">tmp/</a></li>
<li><a href="usr/">usr/</a></li>
<li><a href="var/">var/</a></li>
</ul>
<hr>
</body>
</html>
root@docker-desktop:/#

So … this is more likely a Gradle problem?

Or a more general problem that can happen with similar apps. Do you know if Gradle is using any special protocol or method to discover the port and IP of the daemon?

I got some help from Docker, but we still don’t really understand why the host network breaks the gradle container. Can you share the output of the following commands running on your mac when you also run the gradle container?

cat ~/Library/Containers/com.docker.docker/Data/log/vm/init.log | grep 'init.hostnetwork\|init.dataplane'

You shared the macos command :slight_smile: The Windows PowerShell equivalent should be:

Get-Content "$Env:LOCALAPPDATA\Docker\log\vm\init.log" | Select-String -Pattern "init.hostnetwork|init.dataplane"
1 Like

I was sure we were talking about macOS. I must have confused it with another topic. Thanks for sharing the correct command.

Hi there, so sorry for the late reply, I got dragged into some other issue,

Here is the when run your PowerShell command

[2024-12-19T08:55:43.773081998Z][init.hostnetwork      ] Host networking is disabled because the feature is not enabled in the settings
[2024-12-19T08:58:59.348775619Z][init.hostnetwork      ] The dataplane has been configured...
[2024-12-19T08:59:09.035029494Z][init.hostnetwork      ] A container is binding [::]:42771
[2024-12-19T08:59:10.774691000Z][init.hostnetwork      ] A container is binding [::ffff:127.0.0.1]:43539
[2024-12-19T08:59:10.836099995Z][init.hostnetwork      ] A container is binding [::]:33726
[2024-12-19T08:59:10.893057142Z][init.dataplane        ] trace event received: {Proto:6 OrigDaddr:::ffff:127.0.0.1 NatDaddr:fdc4:f303:9324::254 Dport:43539 Action:1 Step:4}
[2024-12-19T08:59:11.287511302Z][init.hostnetwork      ] A container is unbinding [::]:42771
[2024-12-19T08:59:11.294267865Z][init.hostnetwork      ] A container is unbinding [::]:33726
[2024-12-19T08:59:11.296972842Z][init.hostnetwork      ] A container is unbinding [::ffff:127.0.0.1]:43539
[2024-12-19T08:59:22.155193356Z][init.hostnetwork      ] A container is binding [::]:42659
[2024-12-19T08:59:11.287511302Z][init.hostnetwork      ] A container is unbinding [::]:42771
[2024-12-19T08:59:11.294267865Z][init.hostnetwork      ] A container is unbinding [::]:33726
[2024-12-19T08:59:11.296972842Z][init.hostnetwork      ] A container is unbinding [::ffff:127.0.0.1]:43539
[2024-12-19T08:59:11.287511302Z][init.hostnetwork      ] A container is unbinding [::]:42771
[2024-12-19T08:59:11.294267865Z][init.hostnetwork      ] A container is unbinding [::]:33726
[2024-12-19T08:59:11.287511302Z][init.hostnetwork      ] A container is unbinding [::]:42771
[2024-12-19T08:59:11.287511302Z][init.hostnetwork      ] A container is unbinding [::]:42771
[2024-12-19T08:59:11.294267865Z][init.hostnetwork      ] A container is unbinding [::]:33726
[2024-12-19T08:59:11.296972842Z][init.hostnetwork      ] A container is unbinding [::ffff:127.0.0.1]:43539
[2024-12-19T08:59:22.155193356Z][init.hostnetwork      ] A container is binding [::]:42659
[2024-12-19T08:59:23.192260986Z][init.hostnetwork      ] A container is binding [::ffff:127.0.0.1]:37149
[2024-12-19T08:59:23.213409741Z][init.hostnetwork      ] A container is binding [::]:34163
[2024-12-19T08:59:23.262583505Z][init.dataplane        ] trace event received: {Proto:6 OrigDaddr:::ffff:127.0.0.1 NatDaddr:fdc4:f303:9324::254 Dport:37149 Action:1 Step:4}
[2024-12-19T08:59:23.658192365Z][init.hostnetwork      ] A container is unbinding [::]:42659
[2024-12-19T08:59:23.663519409Z][init.hostnetwork      ] A container is unbinding [::]:34163
[2024-12-19T08:59:23.668269924Z][init.hostnetwork      ] A container is unbinding [::ffff:127.0.0.1]:37149

Some more pretty interesting insight I found is that this is pretty much not specific for the 1st host machine. I just borrowed a new Window 11 machine, no docker installed on this one. I tested using the same procedure (using standard kotlin hello world) and it’s the same error repeated again :sweat_smile: