You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: allow container SSH through iptables DOCKER-USER chain - #161
Single-container builds on native Nebius fail at the container-ssh health check (wait for healthy health check container-ssh: context deadline exceeded). Container SSH (host 2222 → container 22) can't be reached from outside the instance.
Root cause
brev-apply-docker-firewall.sh (applied via the 10-brev-firewall.conf docker.service drop-in) ends DOCKER-USER with -j DROP.
Traffic to Docker-published ports is forwarded through DOCKER-USER, not UFW's INPUT rules, so ufw allow 2222/tcp doesn't help.
Docker rewrites host:2222 to container:22 before the chain runs, so the traffic hits DROP.
Changes
Added a DOCKER-USER rule before the DROP that allows container SSH on host port 2222.
The rule matches on the port the client originally connected to (--ctorigdstport), so only host port 2222 is opened. Other published ports, including other containers' port 22, stay blocked.
does this expose the port directly to the internet or is it via our tunnels? I'm afraid we are exposing this out of bound so can't apply ingress/egress rules via Skybridge.
does this expose the port directly to the internet or is it via our tunnels? I'm afraid we are exposing this out of bound so can't apply ingress/egress rules via Skybridge.
@patelspratik ,
Yes, it opens host port 2222 directly on the instance's public IP, not through Skybridge. The container-ssh health check that dev-plane runs during the build connects to the instance's public address on 2222. On Nebius, the DOCKER-USER DROP rule blocked that, so single-container builds timed out.
This follows the same approach as #100 for Shadeform, and Nebius already allows 2222 in UFW (ufw allow 2222/tcp).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Single-container builds on native Nebius fail at the
container-sshhealth check (wait for healthy health check container-ssh: context deadline exceeded). Container SSH (host 2222 → container 22) can't be reached from outside the instance.Root cause
brev-apply-docker-firewall.sh(applied via the10-brev-firewall.confdocker.service drop-in) endsDOCKER-USERwith-j DROP.DOCKER-USER, not UFW's INPUT rules, soufw allow 2222/tcpdoesn't help.host:2222tocontainer:22before the chain runs, so the traffic hitsDROP.Changes
DOCKER-USERrule before theDROPthat allows container SSH on host port 2222.--ctorigdstport), so only host port 2222 is opened. Other published ports, including other containers' port 22, stay blocked.