Skip to content

Allow to enable host loopback and use 10.0.2.2 to connect to the host (OPTIONALLY)#47352

Merged
thaJeztah merged 1 commit intomoby:masterfrom
serhii-nakon:allow_host_loopback
Feb 29, 2024
Merged

Allow to enable host loopback and use 10.0.2.2 to connect to the host (OPTIONALLY)#47352
thaJeztah merged 1 commit intomoby:masterfrom
serhii-nakon:allow_host_loopback

Conversation

@serhii-nakon
Copy link
Copy Markdown
Contributor

@serhii-nakon serhii-nakon commented Feb 7, 2024

- What I did
I allow to enable host loopback by setting DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK to false,

- How I did it
...

- How to verify it
Set DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK to false and it should allow connections to host by using 10.0.2.2 IP

- Description for the changelog
Allow to enable host loopback by setting DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK to false, defaults true. It allow to connect to host by using 10.0.2.2 IP

- A picture of a cute animal (not mandatory but encouraged)

@AkihiroSuda AkihiroSuda added area/networking Networking area/rootless Rootless Mode labels Feb 8, 2024
@serhii-nakon
Copy link
Copy Markdown
Contributor Author

@AkihiroSuda Hello, can you look at it one more time?

@AkihiroSuda
Copy link
Copy Markdown
Member

Looks good but please squash the commits

@serhii-nakon
Copy link
Copy Markdown
Contributor Author

@AkihiroSuda OK, now it squashed.

Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@serhii-nakon
Copy link
Copy Markdown
Contributor Author

Thank you too

@serhii-nakon
Copy link
Copy Markdown
Contributor Author

Hello @AkihiroSuda does it will be merged or I need something change?

@thaJeztah
Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Contributor

@robmry robmry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In "Description for the changelog", defaults false needs to be changed to defaults to true.

Otherwise, LGTM.

… (OPTIONALLY)

This should allow to enable host loopback by setting
DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK to false,
defaults true.

Signed-off-by: serhii.n <serhii.n@thescimus.com>
@serhii-nakon
Copy link
Copy Markdown
Contributor Author

@robmry I have updated "Description for the changelog"

Copy link
Copy Markdown
Member

@akerouanton akerouanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit b8aa857 into moby:master Feb 29, 2024
@thaJeztah thaJeztah added this to the 26.0.0 milestone Feb 29, 2024
@serhii-nakon
Copy link
Copy Markdown
Contributor Author

Thanks to all of you!

@serhii-nakon serhii-nakon deleted the allow_host_loopback branch March 5, 2024 12:54
MadLittleMods added a commit to matrix-org/complement that referenced this pull request Dec 16, 2025
c.f. `DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns`
and `DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false`

> rootless: Add support for enabling host loopback by setting the `DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK` environment variable to `false` (defaults to `true`). This lets containers connect to the host by using IP address 10.0.2.2. [moby/moby#47352](moby/moby#47352)
>
> _-- https://docs.docker.com/engine/release-notes/26.0/_

> ```
> # * DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=(true|false): prohibit connections to 127.0.0.1 on the host (including via 10.0.2.2, in the case of slirp4netns). Defaults to "true".
> ```
>
> *-- https://github.com/moby/moby/blob/b649e272bb0253fe766069966416b9330a2e38c0/contrib/dockerd-rootless.sh#L18*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment