Dockerize - A small hex package for creating Docker images from an Elixir project.
Hi, guys,
I’ve been playing with Elixir and Docker together for some time and today I’d like to share some of my experiences on running Elixir on Docker to the community. This includes:
Dockerize - the hex package that helps scaffolding
Two Docker base images: elixir-builder & elixir-runner, used by this package by default.
Also, I wrote a blog post on how to do it manually if you want to build your own stacks.
This is a tiny library and many others may have better solutions, but I think it will provide most of the developers a good start on deployment.
So, please check it if you’re going to de deployments, and don’t hesitate to drop any comment or advice. It will help me improving it definitely.
Yes! Alpine is surely amazing. I am a fan of it too but I found that I have to deal with the differences between musl and standard libc. If the library owner uses NIF and doesn’t provide prebuilt binaries, we have to compile it ourselves. Compiling on Alphine today is a bit harder than Debian because musl is not the majority. I’m sure it will get better as Alpine becomes more and more popular.
I picked Alpine because it is super small. But today thanks to Docker layer caching and cloud building, we don’t need to build locally and push to remote, sizing is not a big problem now. making the library smoother to adapt seems more important to me.
Yep, I’ve been bitten once by libmusl when working actively with Rust last year (by the famous slower memory allocation) but I haven’t revisited in a while and I am curious if that has been fixed.
As for NIFs and prebuilt binaries I prefer them built in the container anyway but I get what you are saying!
Yep, got introduced to that several months ago and I loved it. I wonder if people are updating their Docker files en masse to make use of this fantastic feature, hmmmm.
I was shocked by how it simplified the certification flow and image building flow when I tried Rio a year ago. It’s a good direction but by that time it was unstable. I am glad to take your suggestion and give it another try!
I have a trivial hello_world phoenix 1.6 project that I’m trying to dockerize using this tool and I’m running into #32 2.083 npm WARN npm npm does not support Node.js v10.24.0
Hi Maz, could you open an issue on Github? I just tried the latest version of Phoenix (1.6.6) and it works. According to your log, I assume this is something related to the assets compiling so if you create a repo to reproduce it, it will be perfect.