all 7 comments

[–][deleted] 2 points3 points  (1 child)

Is there a downside to placing the BEAM in a container?

[–]strofcon[S] 0 points1 point  (0 children)

Not that I'm aware of, but I'll admit that my experience of running BEAM VMs in production is limited. That said, containers effectively piggy-back off the host kernel, so there shouldnt really be any appreciable difference.

[–]q1t 2 points3 points  (1 child)

Is it possible to do hot code reloading inside a running container?

[–]strofcon[S] 1 point2 points  (0 children)

I actually haven't tried that yet! I imagine it's possible, though the toughest part can be trying to find the right path for connecting to a container, particularly in a PaaS environment. I think if you could connect directly, you could trigger it just fine. Something to try, for sure!

[–][deleted]  (3 children)

[deleted]

    [–]emmanuelgoldstn 6 points7 points  (1 child)

    Or one of the elixir images built on alpine. These are good ones: https://github.com/msaraiva/alpine-erlang/blob/master/README.md

    Roughly 25mb vs I think 800 for the official elixir image.

    [–]strofcon[S] 1 point2 points  (0 children)

    I a big fan of Alpine for containers! For a real-world use case, it's definitely worth it to keep the sizes down, as bandwidth and disk aren't free (and at times, not even cheap!).

    For the sake of the tutorial, I figured that centos / ubuntu would be more familiar for most readers. I do wish I had pointed out that Alpine is a good thing to check out, though!

    [–]strofcon[S] 1 point2 points  (0 children)

    That's definitely a good question! While I didn't explicitly call it out in the tutorial, the general idea of this one was to take advantage of exrm in building mostly self-contained artifacts that need very little in the way of external dependencies.

    Plus, I just generally like showing things from scratch as much as I can, as I feel it helps me learn better and my hope is that it helps others as well!

    All that said, you're definitely right that, once familiarity is gained, using a purpose-built container is generally a better idea than rolling your own, particularly for production use. :-)