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






















