cheerfulstoic
Sharing CircleCI configuration / Dockerfile to build, test, and push Elixir Docker images
I spent quite a bit of time trying to find a good configuration to build / test my Elixir app in CircleCI and then push an image to Docker Hub. It is probably a somewhat common thing, but I did a lot of research and trial and error moving around different steps until I got it to a good point. I wanted to share in case in ended up being useful to somebody else searching Google 
Features:
- Uses Circle CI caching for dependencies / compiled files
- Runs tests + code checks (using
ex_check) - Builds and pushes images to Docker Hub:
- One tag with the Circle CI build number
- One tag with the git sha
- One tag with
latest(if the current branch ismain)
- A
Dockerfileis included which uses Docker’s multi-stage builds and Elixir releases so that the resulting images (for this simple app) ends up around 12.5 MB
I’ve made it available in a GitHub Gist:
Comments welcome here or there
First Post!
dimitarvp
Thank you for sharing this! I’ll be trying it in the future.
Have you considered making other images not based on Alpine btw? I might try your Dockerfile with Ubuntu 20.04 which is one of the smaller images.
Popular in Guides/Tuts
Did you know that IO.inspect/2 returns the the first argument and accepts a label option as a second argument. This makes it a perfect to...
New
Hey friends, wanted to share a tiny shell script I’ve been using to start Livebook with easy access to either a running production server...
New
Some time ago someone suggested me to write article about how I have configured my Vim to work with Elixir, now there it is:
https://med...
New
Geoffrey Lessel’s 2019 book, Phoenix in Action, was written for Phoenix 1.4.
I found that the book’s code examples did not match the cur...
New
For those of you who might be interested in using ZeroMQ in Elixir, I converted the Erlang examples in the ZeroMQ “zguide” to Elixir. I ...
New
Install web-mode and mmm-mode first and put this in your config file:
(require 'mmm-mode)
(require 'web-mode)
(setq mmm-global-mode 'may...
New
This post is intended to be a guide for others, I was running a remote debugger for the first time and appreciate feedback on how I could...
New
We finally have a Mix clustering guide to go with Phoenix deployment with Mix Releases.
Deploy an Elixir Cluster with Mix Releases and l...
New
With a few questions relating to this recently, I wonder if it might help having a thread where we share how we’ve set up Elixir/Erlang/P...
New
Hey :wave:t3: Elixir community,
I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New
Other popular topics
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum.
...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors:
[WARN] - (starship::utils): Executing command ...
New







