manhvu

manhvu

Recently, I’ve heard people using dev containers for development. I want to give it a try—has anyone here developed an Elixir app with them? Any tips or experiences would be appreciated.

I’m working on an Elixir cluster (Phoenix + Postgres) on macOS, with Kubernetes as the deployment environment.

Showing Posts 1 to 10

NobbZ

NobbZ

I know that my co-worker is using containers for development, though I don’t know if he does it the dev-containers way.

Also I don’t know if he is active on this forum or whether he has an account.

DGollings

DGollings

Personally I’d advise using something like devenv.sh instead of a dev container. Most of the advantages without the disadvantages of Docker.

Been using that for two years, a dev can switch between any project and have the exact same setup as any other dev in a matter of moments

allen-munsch

allen-munsch

They are nice for a uniform and reproducible development environment.

They are NOT great when used in github’s browser based devcontainer environment ( extremely slow, laggy ).

I see it as trading in one set of problems for another. ( easily reproducible dev envs, for docker debugging issues )

In the same sense that having a web app inside the container network is a pain, because you’ll have a layer of problems arise from the internal DNS, networking layer, volume mount issues, files missing, etc, meaning there’s more stuff to go wrong in comparison to just having the standard stuff go wrong ( service ports not open, dependencies missing )

just my opinion, nice for initial start, less nice for long term debugging, but still okay

It’s a layer of abstraction, so it doesn’t help developers with learning how to do things manually when stuff goes wrong.

It might just be how i like things, but it really bugs me when tools get in the way, and its especially true for visual studio code and dev containers, its just a layer ( hey its great if its working, but at the same time, I don’t want to spend a few hours debugging/configuring/diagnosing the tool, the plugin, the whatever, just so i can get to the work )

rocket4ce

rocket4ce

Hi! I just created a template for a Phoenix 1.8.3 project using Docker and Docker Compose, both for production deployment and for running Docker Compose in development mode.

Feel free to download it and adapt it to your needs. If you have any questions, you can send me a message — I’d be happy to help you with whatever you need :slight_smile:

https://github.com/rocket4ce/template_docker_dev

allen-munsch

allen-munsch

I’m wondering if the question was originally about this?

See:

I only did a quick skim of the repo you shared ( which looked promising for sure ), or maybe I misunderstood the original question.

I thought the original question was about devcontainer.json setup?

I think it’d be straight forward to vibe into your template_docker_dev repo?

manhvu

manhvu OP

Thank for your suggestion!

Actually, I thought about dev container because it have same env for dev & deployment environment. We have some issues in early day when we run project on multi environment (macOS, Windows).

manhvu

manhvu OP

Thanks for sharing! It sounds like we might be creating more trouble instead of making things simpler. I’ve spent a lot of time bringing the local/dev cluster to Kubernetes, and that’s also why I started thinking about dev containers.

Currently, I use the Zed editor for development (VS Code is too slow for me). I develop with multiple nodes, so that might be an issue if I use dev containers.

manhvu

manhvu OP

Thank you so much!

allen-munsch

allen-munsch

Do you mean Create a Dev Container? I’m a bit confused about the original question.

Or just like containers in general? like docker containers, kubernetes pods with helm charts?

Cause then what rocket4ce posted is totally relevant.

But my recommendation would be to make it easy to run the web app locally outside of the container network, as many things can break down in the container for webapps, debugging, stdout, stderr, tty for breakpoint debugging, gdb, valgrind, delv, etc

As far as just general k8s related container tooling there’s tons of it, but several come to mind for general pod development classically I have used minikube, more recently i’ve looked at k3s, and tilt i really like the spirit of what tilt has going on, especially for any sprawling microservice architecture ( 7+ services ) ( but again a level abstraction, and yet another tool, and I haven’t used it enough to find out how much it complicates things )

But this doesn’t solve the issue of installing the dev dependencies themselves, which is why I thought you were asking about devcontainers.json, which i’d second a vote with DGollings suggestion using the nix based devenv.sh

manhvu

manhvu OP

" Do you mean Create a Dev Container? I’m a bit confused about the original question."

Sorry for not clear question, I want to ask about experience & pros/cons when work with dev container. Your answer in last post is good info for me.

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews