Skip to content

engine: add docs for host-gateway#17679

Merged
dvdksn merged 2 commits into
docker:mainfrom
dvdksn:engine/host-gateway
Aug 9, 2023
Merged

engine: add docs for host-gateway#17679
dvdksn merged 2 commits into
docker:mainfrom
dvdksn:engine/host-gateway

Conversation

@dvdksn

@dvdksn dvdksn commented Jul 4, 2023

Copy link
Copy Markdown
Contributor
  • engine/desktop: update references to host.docker.internal
  • engine(cli): regenerate --add-host flag reference

Proposed changes

Adds documentation for host-gateway with --add-host.

Related issues (optional)

docker/cli#4399
Closes #17597

@netlify

netlify Bot commented Jul 4, 2023

Copy link
Copy Markdown

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit f391400
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/64c7d58d18c1370008b11b67
😎 Deploy Preview https://deploy-preview-17679--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dvdksn
dvdksn marked this pull request as ready for review July 4, 2023 08:26
@dvdksn
dvdksn requested a review from aevesdocker as a code owner July 4, 2023 08:26
@dvdksn
dvdksn requested review from akerouanton and thaJeztah July 4, 2023 08:26
@dvdksn

dvdksn commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

@akerouanton PTAL at these changes for describing the special host-gateway value of --add-host. Also the related CLI pull request, which adds an example for host-gateway-ip dockerd config (maybe there's more to say there?)

@akerouanton akerouanton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@dvdksn
dvdksn force-pushed the engine/host-gateway branch from 811ca43 to f391400 Compare July 31, 2023 15:38
@dvdksn
dvdksn requested a review from a team July 31, 2023 16:49
@dvdksn
dvdksn merged commit b2972b1 into docker:main Aug 9, 2023
@dvdksn
dvdksn deleted the engine/host-gateway branch August 9, 2023 11:46
@iTrooz

iTrooz commented Apr 8, 2024

Copy link
Copy Markdown

I think that https://docs.docker.com/desktop/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host should also mention host-gateway. For now, it makes it sounds like host.docker.internal and gateway.docker.internal should work out of the box

@pip25

pip25 commented Sep 27, 2024

Copy link
Copy Markdown

@iTrooz Because it does work out of the box - but only on Docker Desktop. On Linux, you have to use host-gateway.
Confusing? You bet.

@thaJeztah

Copy link
Copy Markdown
Member

Yeah that those docs linked above are in the Docker Desktop section. Docker Desktop originally introduced the host.docker.internal feature, effectively as workaround for limitations on Desktop that were not present on Linux. However that concept (magic host.docker.internal host) got used by various people, who expected it to also work on Linux.

On Linux, it's more complicated, due to a much wider range of possible setups, where networking can be very different, so it's not possible to set a sensible default. In addition, in production environments it's not always desirable to have the domain added automatically, so on Linux, this feature has to be manually set (there is still a pending ticket to consider having a configurable option for this; docker/cli#2290).

@thaJeztah

Copy link
Copy Markdown
Member

All that said, perhaps it makes sense to move this topic to a more "general" location, update it with "on desktop this is automatic; on Linux, these are the steps to do the equivalent), and to link that section from the current location in the Desktop manual

any thoughts @dvdksn @akerouanton ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

document "host-gateway" feature, and how to use it for host.docker.internal

6 participants