[BUG] Devcontainer init-firewall.sh duplicate ip failure

Resolved 💬 7 comments Opened Dec 28, 2025 by uler3161 Closed Mar 1, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I'm trying to get started with running Claude Code in a Docker container. I've been using How to Safely Run AI Agents Like Cursor and Claude Code Inside a DevContainer as a reference. Once I reopen in container, it runs init-firewall.sh and fails with an error about duplicate IPs being added.

I'm not a big expert on Linux commands, but from what I've read, perhaps this line:

ipset add allowed-domains "$ip"

Needs to be changed to:

ipset add allowed-domains "$ip" -exist

That seemed to get me past the issue. I'm unsure what the actual cause of duplicate IPs was, so perhaps the real problem is network related. I don't believe there's anything crazy with the local network configuration. This is a fairly fresh install of Windows 11 on a new PC. No VPN involved. ISP is Starlink.

What Should Happen?

The container should run without failure.

Error Messages/Logs

[2025-12-28T18:03:41.870Z] Adding 150.171.73.16 for marketplace.visualstudio.com
Adding 150.171.74.16 for marketplace.visualstudio.com
Adding 150.171.74.16 for marketplace.visualstudio.com
ipset v7.17: Element cannot be added to the set: it's already added
[2025-12-28T18:03:41.933Z] Stop (971 ms): Run in container: /bin/sh -c sudo /usr/local/bin/init-firewall.sh
[2025-12-28T18:03:41.934Z] postStartCommand from devcontainer.json failed with exit code 1. Skipping any further user-provided commands.
[2025-12-28T18:03:41.935Z] Error: Command failed: /bin/sh -c sudo /usr/local/bin/init-firewall.sh
[2025-12-28T18:03:41.935Z]     at E (c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js:235:157)
[2025-12-28T18:03:41.935Z]     at async Promise.allSettled (index 0)
[2025-12-28T18:03:41.935Z]     at async b9 (c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js:237:119)
[2025-12-28T18:03:41.935Z]     at async ND (c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js:226:4668)
[2025-12-28T18:03:41.935Z]     at async M9 (c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js:226:4185)
[2025-12-28T18:03:41.935Z]     at async MD (c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js:226:3377)
[2025-12-28T18:03:41.935Z]     at async G7 (c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js:668:2746)
[2025-12-28T18:03:41.935Z]     at async b7 (c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js:667:8546)
[2025-12-28T18:03:41.935Z]     at async c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js:484:1188
[2025-12-28T18:03:41.944Z] Stop (1402 ms): Run: C:\Users\uler3\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js run-user-commands --user-data-folder c:\Users\uler3\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-2b8f7ff9-7958-492f-8dd1-6c75cdd590581766945017822 --workspace-folder c:\Users\uler3\Documents\Claude Projects\Bitcoin SAT --id-label devcontainer.local_folder=c:\Users\uler3\Documents\Claude Projects\Bitcoin SAT --id-label devcontainer.config_file=c:\Users\uler3\Documents\Claude Projects\Bitcoin SAT\.devcontainer\devcontainer.json --container-id 08b03497ab54cf959d43d99502f13d7adae0e0a33aa7146b07935536702dd9fc --log-level debug --log-format json --config c:\Users\uler3\Documents\Claude Projects\Bitcoin SAT\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --skip-non-blocking-commands true --prebuild false --stop-for-personalization false --remote-env REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-294b7d6c-781f-458e-a342-4c1f11ac09f0.sock --remote-env DISPLAY=:7 --remote-env REMOTE_CONTAINERS_DISPLAY_SOCK=/tmp/.X11-unix/X7 --remote-env REMOTE_CONTAINERS=true --mount-workspace-git-root --dotfiles-target-path ~/dotfiles
[2025-12-28T18:03:41.944Z] Exit code 1
[2025-12-28T18:03:41.946Z] Command failed: C:\Users\uler3\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\uler3\.vscode\extensions\ms-vscode-remote.remote-containers-0.434.0\dist\spec-node\devContainersSpecCLI.js run-user-commands --user-data-folder c:\Users\uler3\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-2b8f7ff9-7958-492f-8dd1-6c75cdd590581766945017822 --workspace-folder c:\Users\uler3\Documents\Claude Projects\Bitcoin SAT --id-label devcontainer.local_folder=c:\Users\uler3\Documents\Claude Projects\Bitcoin SAT --id-label devcontainer.config_file=c:\Users\uler3\Documents\Claude Projects\Bitcoin SAT\.devcontainer\devcontainer.json --container-id 08b03497ab54cf959d43d99502f13d7adae0e0a33aa7146b07935536702dd9fc --log-level debug --log-format json --config c:\Users\uler3\Documents\Claude Projects\Bitcoin SAT\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --skip-non-blocking-commands true --prebuild false --stop-for-personalization false --remote-env REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-294b7d6c-781f-458e-a342-4c1f11ac09f0.sock --remote-env DISPLAY=:7 --remote-env REMOTE_CONTAINERS_DISPLAY_SOCK=/tmp/.X11-unix/X7 --remote-env REMOTE_CONTAINERS=true --mount-workspace-git-root --dotfiles-target-path ~/dotfiles
[2025-12-28T18:03:41.946Z] Exit code 1

Steps to Reproduce

I'm not sure if this is easily reproducible. I expected other people to have had this issue and I didn't see any bug reports for it. I suspect there's some odd network related issue causing duplicate IPs, but I'm unsure what the cause is.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

None

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗