devcontainers / templates

Repository for Dev Container Templates that are managed by Dev Container spec maintainers. See https://github.com/devcontainers/template-starter to create your own!
https://containers.dev/templates
MIT License
859 stars 226 forks source link

ruby-rails-postgres devcontainer has no internet access #222

Closed McSlow closed 7 months ago

McSlow commented 7 months ago

Just tried the ruby-rails-postgres devcontainer (https://github.com/devcontainers/templates/tree/main/src/ruby-rails-postgres)

I'm not sure if i'm doing something fundamentally wrong. Just created the above devcontainer. When creating a new project ( e.g. rails new someapp) or resolving deps (bundle install etc), rails or the bundler will try to resolve dependencies and download packages from rubygems.org etc.

unfortunately the app container is set to network_mode: service_db (https://github.com/devcontainers/templates/blob/main/src/ruby-rails-postgres/.devcontainer/docker-compose.yml#L16) and not to 'bridge' or 'host', leaving it without any internet access- so all of those commands will fail leaving you stuck.