Skip to content

desktop: fix the air-gapped containers block and allow examples - #26607

Merged
aevesdocker merged 1 commit into
docker:mainfrom
mat007:air-gapped-block-all-example
Nov 12, 2026
Merged

aevesdocker merged 1 commit into
docker:mainfrom
mat007:air-gapped-block-all-example

Conversation

@mat007

@mat007 mat007 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Description

The "Block all external access" and "Allow specific internal services" examples have no PAC script, so container connections go straight out and nothing is blocked.

This replaces both with an inline PAC script, and notes that image pulls are blocked too.

Related issues or tickets

SEG-1871

Reviews

Checked on Docker Desktop 4.100.0 on Windows: with the old block example, internet and host access from a container still work. With the new one they are blocked, and so is docker pull. To verify, run docker run --rm alpine wget -O- https://www.google.com, which should fail.

  • Technical review
  • Editorial review
  • Product review

@netlify

netlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for docsdocker ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9c0ce0d
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6af56cc0e5956c97f8b48d96
😎 Deploy Preview https://deploy-preview-26607--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 project configuration.

@github-actions github-actions Bot added the area/desktop Issue affects a desktop edition of Docker. E.g docker for mac label Nov 10, 2026
@mat007
mat007 force-pushed the air-gapped-block-all-example branch from d9a7d05 to 7420d93 Compare November 10, 2026 17:02
@mat007
mat007 marked this pull request as ready for review November 10, 2026 17:07
@mat007
mat007 requested a review from aevesdocker as a code owner November 10, 2026 17:07
"locked": true,
"mode": "manual",
"http": "",
"https": "",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mat007 @aevesdocker we need to add line 94 here as well "embeddedPac": ....

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PAC file doesn't honor exclude list, as the exclusion is specified in the PAC file itself. I am not sure if embededPac honors exclude list specified in the proxy stanza. I will test tomorrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok, we should add
"embeddedPac": "function FindProxyForURL(url, host) { if (isInNet(host, "10.0.0.0", "255.0.0.0")) {return "DIRECT";} return \"PROXY reject.docker.internal:1234\"; }",

and remove "exclude" setting on line 109 or set the value to empty "exclude": [].

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@karman-docker I updated the doc with a slight variant, after verifying locally. Can you take a look?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm, thank you.

The block all example set only empty http/https values and
transparentPorts, with no PAC script and no proxy. With nothing to route
through, container connections go straight out, so it blocked nothing.
The allow specific internal services example had the same problem, as
exclude only bypasses a proxy and nothing was restricting the rest.

Use an inline PAC script in both. The block all one rejects every
request, which also blocks image pulls. The allow one returns DIRECT for
the internal domain and addresses and rejects the rest. exclude cannot
override a PAC rejection, so it is left empty. Add embeddedPac to the
parameters table.
@mat007
mat007 force-pushed the air-gapped-block-all-example branch from 7420d93 to 9c0ce0d Compare November 12, 2026 07:37
@mat007 mat007 changed the title desktop: fix the air-gapped containers block all example desktop: fix the air-gapped containers block and allow examples Nov 12, 2026

@aevesdocker aevesdocker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @mat007

@aevesdocker
aevesdocker merged commit 91082cb into docker:main Nov 12, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/desktop Issue affects a desktop edition of Docker. E.g docker for mac

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants