Container with host network

How can I get workspace containers deployed by coder onto the coder host's network? Normally, they seem to only have docker internal networking and can't be reached from the outside.
5 Replies
Codercord
Codercord5mo ago
Codercord
Codercord5mo ago
<#1369779743771070545>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Phorcys
Phorcys5mo ago
hey @journeywolf, this is possible but i'd like to know your use-case for this it feels like the wrong solution to the problem you might be facing, we usually don't want every container deployed by coder to be on the host's network to avoid security issues and avoid port collision between workspaces
journeywolf
journeywolfOP5mo ago
Thanks. I agree and in many cases also would want a container not to be on the host network. But my particular use case is that my code runs a web server and I want to be able to connect to that from my local machine (without VPNs etc) to test it to see how it behaves in a "normal" setting. So, ideally, I would be able to create a new template for this use case and keep using the normal template for isolated containers.
Phorcys
Phorcys5mo ago
Coder has this feature, you only have to add a wildcard subdomain see https://coder.com/docs/user-guides/workspace-access/port-forwarding#dashboard

Did you find this page helpful?