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
I'm trying to set up Dev Containers for a multitenant application with Caddy in front for local HTTPS and handling arbitrary subdomains.
I'd like to think that this would be a pretty appealing setup? 🤔 Haven't found any other reference projects or mentions, so I guess I'm totally off here. Still... would be sweet wouldn't it?
The Gist
Where I'm at is that I've successfully had caddy-docker-proxy doing a respond "Hello world" given devcontainer.localhost (defined in Hosts file) using labels from the Dev Container. However, trying to use caddy.reverse_proxy: "{{upstreams 4000}}" gives me a Container is not in same network as caddy message in the caddy-docker-proxy container.
The Setup
The Docker-Caddy-Proxy docker-compose.yml.
Please note that the network name used here is devcontainer_network.
Attempting a curl -v https://devcontainer.localhost from my host gives me a "Container is not in same network as caddy".
caddy-1 | {"level":"warn","ts":1722239905.152906,"logger":"docker-proxy","msg":"Container is not in same network as caddy","container":"0d29118c6d45032e479010e7647c9430f00f4bc2499364223d77dacad4957862","container id":"0d29118c6d45032e479010e7647c9430f00f4bc2499364223d77dacad4957862"}
Please note that the way Dev Containers are set up according to the documentation is using network_mode: service:db. I have tried creating networks such as caddy with docker network create caddy but haven't gotten that working with the communication between the devcontainer service and the db service above. I get the sense that network_mode: service:db is the supported way of doing networking with Dev Containers and have tried to stay with that.
Also please note that I've tried shutting everything down and doing a docker system prune -a before starting up again, but to no avail.
If anyone is interested in supporting this effort I'd be most grateful. I don't expect anyone to help out, but if there's interest, perhaps there's something of value to the community 🙂
The text was updated successfully, but these errors were encountered:
Could you please run docker network ls and verify that you have a network named devcontainer_network ?
Docker compose usually adds prefix to networks, so I think it's likely that this is not really the name of your network.
Try giving it a name as:
I won't be able to test this anytime soon due to limited bandwidth, but I very much want to. I'll close the issue with this comment so that it's not left open.
Dear all 👋🏻
I'm trying to set up Dev Containers for a multitenant application with Caddy in front for local HTTPS and handling arbitrary subdomains.
I'd like to think that this would be a pretty appealing setup? 🤔 Haven't found any other reference projects or mentions, so I guess I'm totally off here. Still... would be sweet wouldn't it?
The Gist
Where I'm at is that I've successfully had
caddy-docker-proxy
doing arespond "Hello world"
givendevcontainer.localhost
(defined inHosts
file) using labels from the Dev Container. However, trying to usecaddy.reverse_proxy: "{{upstreams 4000}}"
gives me aContainer is not in same network as caddy
message in thecaddy-docker-proxy
container.The Setup
The Docker-Caddy-Proxy
docker-compose.yml
.Please note that the network name used here is
devcontainer_network
.The
devcontainer_network
is created by the Dev Containerdocker-compose.yml
using the default network name:Attempting a
curl -v https://devcontainer.localhost
from my host gives me a"Container is not in same network as caddy"
.Please note that the way Dev Containers are set up according to the documentation is using
network_mode: service:db
. I have tried creating networks such ascaddy
withdocker network create caddy
but haven't gotten that working with the communication between thedevcontainer
service and thedb
service above. I get the sense thatnetwork_mode: service:db
is the supported way of doing networking with Dev Containers and have tried to stay with that.Also please note that I've tried shutting everything down and doing a
docker system prune -a
before starting up again, but to no avail.If anyone is interested in supporting this effort I'd be most grateful. I don't expect anyone to help out, but if there's interest, perhaps there's something of value to the community 🙂
The text was updated successfully, but these errors were encountered: