Docker container image for Phoenix development with specific OS, Erlang and Elixir versions

Hi, everyone!
If I want to develop a Phoenix project and build a release specifically for Ubuntu 18.04 (bionic), Erlang 22 and Elixir 1.10.2 in Docker container and I’m looking for an image to base my Dockerfile from what is my best option?
I’ve read a topic on this forum that hexpm published docker images for all erlang and elixir versions. I went to docker hub and found hexpm/elixir:1.10.2-erlang-22.2-ubuntu-bionic-20200219 image.
Seems exactly what I need, but I’m not sure because in the description of the image I don’t see what’s installed, the layers add some file and copy some dir, that’s basically it.
The link to the image: https://hub.docker.com/layers/hexpm/elixir/1.10.2-erlang-22.2-ubuntu-bionic-20200219/images/sha256-365b4ff8cf345bb1e7909cd0e00af4686cddc0d04fffdc6bd2f0decd2544763f?context=explore
Besides Elixir code I need to build some c code in the container (bcrypt is used) and a webpack stuff for Phoenix, so is it enough to just make a Dockerfile like this:

FROM hexpm/elixir:1.10.2-erlang-22.2-ubuntu-bionic-20200219

RUN apt-get update && \
    apt-get install -y postgresql-client && \
    apt-get install -y inotify-tools && \
    apt-get install -y nodejs && \
    curl -L https://npmjs.org/install.sh | sh && \
    mix local.hex --force && \
    mix archive.install hex phx_new 1.5.3 --force && \
    mix local.rebar --force

ENV APP_HOME /app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME

CMD ["mix", "phx.server"]

or I should add more tooling? Or I shouldn’t use this image for my purpose and start building my image from scratch? I’m new to docker, so have many doughts.

Only Erlang, Elixir and Mix are pre-installed.

If you need to build some C code, build-essential is what you want in the building-stage image. (you don’t want it in your running-stage image.)

You also need to install nodejs <= 10.x and npm in the building-stage image unless you generated your Phoenix app with the --no-webpack --no-html options.

Thank you for a reply, Aetherus! I’ve added build-essential installation step to my Dockerfile but to test my containerized app I still need to figure out how to add a postgres database for the app to communicate to. As soon as I get it out of my way, I’ll come back here to report the results.

You can certainly add postgresql to your dependencies (just follow the postgresql docs on how to install it in Debian/Ubuntu but inside your Dockerfile), but even for a development environment that is not super ergonomic. You might want to look at docker-compose which would allow you to use a postgres image that is pre-built and configured for quick use.
If you want a few pointers for where to look I’d be happy to point you in the right direction, but if you just want a quick start you can Google something like “Phoenix postgres docker-compose” and find a few solid guides to get started

Thank you for help! By the way, in my Dockerfile I added a postgres client, not a server, I’ll follow your advise and add a docker-compose.yml file with a postgres service.