akalan
Docker image for cross-building Elixir/Phoenix apps to CentOS/RHEL
Docker image with Erlang, Elixir, and NodeJS on CentOS for cross-building Elixir/Phoenix apps as OTP releases.
Uses CentOS official base image and official binary
builds of Erlang, Elixir, and NodeJS.
Versions:
- CentOS:
7.6(x86-64) - same as RHEL 7.6 - Erlang:
22.0.4 - Elixir:
1.9.0 - NodeJS:
10.16.0
Warning: Do not use this image to deploy the app as the size is quite large at ~598MB
For an example build file that cross-builds a Phoenix app, refer to phoenix/build-release.sh file.
This file should be placed at the root of the Elixir/Phoenix project and:
# Run the build script inside a container running this image
# Note: On Windows replace $(pwd) with the actual path
docker run -v $(pwd):/home --rm -it akalan/elixir-centos /home/build-release.sh
# Run the generated release inside the same container
docker run -v $(pwd):/home --rm -it akalan/elixir-centos /home/_build/prod/rel/appname/bin/appname
The release is tarred and zipped to releases/appname-version-utc_time_stamp.tar.gz
Most Liked
chulkilee
Quick feedback
General Docker
- Check the checksum of any downloaded files
- Clean up cache - e.g.
yum updatewill create caches, so remove all caches in the sameRUN- probably it explains the size of the image - Leverage layers to maximize caching
- e.g. changing Elixir version should not invalid layers for erlang
Erlang/Elixir
- Seems like there is no official repo; then you can just easily build it with src from Releases · erlang/otp · GitHub
- Precompiled elixir from github release is compiled for the oldest supported OTP, which means you may not leverage the new OTP features
- compile Elixir with the latest OTP, or
- download precompiled elixir from
https://repo.hex.pm/builds/elixir/v${ELIXIR_VERSION}.zip(it’s from GitHub - hexpm/bob: The Builder · GitHub )
- erlang 20.0.4 had a bad bug (ERL-986) - so use the latest version (at least 22.0.5)

At work, we use Red Hat Universal Base Image - so I created dockerfile for Erlang and Elixir from ubi7 (Red Hat Universal Base Image 7) - check out Chulki Lee / docker-images · GitLab
Popular in Discussions
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








