Repository navigation
Description
I have done the following
- I have searched the existing issues
- If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
(Expected container system is installed and running)
- start a test container: container run --rm -d --name port-test -p 127.0.0.1:8080:80 nginx:alpine
- try to connect to the published port: curl http://127.0.0.1:8080
Expected: a response should be shown
Actual: curl: (56) Recv failure: Connection reset by peer
Problem description
I'm not entirely sure if it is needed to open this bug report here, as this seems to be an issue with the MacOS 27 (beta). However, for visibility I wanted to still open this issue :) I also submitted this as feedback to Apple with ID FB24027799
When running a container with apple/container on the latest official release (1.1.0 with the signed installer), trying to expose/publish a port to forward traffic from the host to the container, forwarding network traffic to the container does not work.
Steps to reproduce:
(Expected container system is installed and running)
- start a test container:
container run --rm -d --name port-test -p 127.0.0.1:8080:80 nginx:alpine - try to connect to the published port:
curl http://127.0.0.1:8080
Expected: a response should be shown
Actual: curl: (56) Recv failure: Connection reset by peer
Directly connecting to the container IP address (192.168.64.x) does work flawlessly. Showing the logs of the container system (container system logs) reveals:
2026-07-28 10:54:22.166352+0200 0x33afb Error 0x0 22119 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] backend - connect failed: connect(descriptor:addr:size:): No route to host) (errno: 65) [uuid=port-test] [server=[IPv4]127.0.0.1/127.0.0.1:53710] [proxy=[IPv4]127.0.0.1/127.0.0.1:8080]
In MacOS 26, when trying to connect, TCC asks for local network access for “container-runtime-linux”. This permission prompt neither shows in MacOS 27 beta, nor does container-runtime-linux appear in the list of apps in Settings -> Privacy & Security -> Local Network.
Environment
- OS:macOS 27 beta (26A5388g)
- Xcode: -
- Container: container CLI version 1.1.0 (build: release, commit: 5973b9c)Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
terryzwt commentedon Jul 31, 2026
same here.
jcbl1 commentedon Aug 3, 2026
same on container 1.2.0 and macos 27 (26A5388g).
Workarounds:
option 1: use 192.168.64.x instead
option 2: according to official technote,
sudo defaults write com.apple.network.local-network AllowedEthernetLocalNetworkAddresses -array "192.168.64.0/24"sudo defaults write com.apple.network.local-network AllowedWiFiLocalNetworkAddresses -array "192.168.64.0/24"a reboot may be needed.
JamesATUK commentedon Aug 6, 2026
I’m running macOS 26.6 and container 1.2 and also getting this error, even with the correct TCC local network permission.
rfay commentedon Aug 6, 2026
I can confirm this on macOS 27 beta (26A5388g — same build as the original report),
container1.2.0, signed installer (installRoot: /usr/local/), and can add a couple of data points that narrow this down further.Reversible on/off repro via the TCC grant itself. Toggling the
container-runtime-linuxentry in System Settings > Privacy & Security > Local Network off and on directly reproduces and clears the symptom in this issue (Recv failure: Connection reset by peeron a published port, direct connection to the container's own IP unaffected). Confirmed both directions, live:@jcbl1's subnet-preauth workaround (option 2) works, but needs a reboot. I tested this in isolation — TCC permission for
container-runtime-linuxleft OFF the whole time, so the workaround alone is what's under test:Immediately after applying it, forwarding still reset — no effect without a reboot. After rebooting (defaults persisted, TCC grant confirmed still OFF via System Settings), the exact same repro returned a clean
200 OK. So this seems to work as a system-level bypass of the per-app TCC grant, it just isn't live until reboot — worth calling out explicitly since it's easy to conclude the workaround "doesn't work" if tested without one, the same trap I fell into initially.This doesn't seem to explain: @JamesATUK's report that it fails "even with the correct TCC local network permission" on macOS 26.6 stable. My testing only shows the inverse case (workaround succeeds despite TCC being off), not a case where TCC is on/correct and it still breaks. A couple of things worth checking on his end to narrow that down further:
containerinstall (e.g. both the signed installer and a Homebrew build)? Both declare the same bundle identifier (com.apple.container.container-runtime-linux) despite being signed completely differently (TeamIdentifier set vs. ad-hoc, hardened runtime vs. not) — it's plausible the entry shown as "granted" in Settings doesn't correspond to the binary actually invoked.container ls -ashows the IP) — if it's not192.168.64.0/24, the same preauth approach would need the matching subnet.Happy to help build out a more targeted repro for the "TCC says granted, still fails" case if that's useful for narrowing root cause — this is blocking Docker-API compatibility layers (e.g. socktainer) that downstream tools like DDEV depend on for published-port workflows, so we've got a fair amount of test surface to work with.
JamesATUK commentedon Aug 7, 2026
To add more info to this:
Only one container present.
Standard subnet 192.168.64.0/24
I’m very new to this so apologies if this is expected or I missed something but port mapping seems not to function at all. If I try the simple Nginx example shown above, I can connect to the 192.168.64.0/24 address but connecting to either loopback or my actual ip address or hostname fails every time. That is, no services are available to any other device on the lan from a container running on my Mac.
Test and document Apple container setup on macOS
pjezek commentedon Aug 18, 2026
Thanks for this issue and mentioned workaround mentioned in #2029 (comment).
I could reproduce this issue on OSX 26.6.2 with container CLI version 1.2.2 (build: release, commit: unspeci).
The workaround works after restart:
container run -d -p 127.0.0.1:8080:8000 --rm --name my-web-server python:alpine python3 -m http.server 8000Have a nice day.
Update note: I am affected from: #1307 once I start VPN. Without VPN It works as expected. With VPN it seems that I can use IPv6.
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
FlorianSW commentedon Aug 28, 2026
Apple answered to my feedback and indicated that there is a fix shipped with MacOS 27 Beta 7:
I've installed that beta already and container-runtime-linux is now correctly listed in the Privacy & Security settings, and I can turn that on and off. The traffic is no also correctly forwarded to the container when doing the steps from the initial issue.
Can one of you verify my results so that I can close this issue? :)
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
rfay commentedon Aug 28, 2026
Yes, fixed! I'm running 26A5421a from the public beta and now got past this problem.
fix(apple-container): make Traefik see config changes through the bin…
2 remaining items
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
fix(apple-container): make Traefik see config changes through the bin…
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
fix(apple-container): make Traefik see config changes through the bin…
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
fix(apple-container): make Traefik see config changes through the bin…
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
fix(apple-container): make Traefik see config changes through the bin…
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
fix(apple-container): make Traefik see config changes through the bin…
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
fix(apple-container): make Traefik see config changes through the bin…
Linux VM mode: BROWSER_WORKER_MODE=vm installs a separate worker whos…
docs(apple-container): record 1.2.2 verification run and macOS 27 TCC…
fix(apple-container): make Traefik see config changes through the bin…