igor
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: Image Layer Details - hexpm/elixir:1.10.2-erlang-22.2-ubuntu-bionic-20200219
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.
First Post!
Aetherus
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.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










