Dockerize is an Elixir package that helps you create Docker images from Elixir projects.
dockerize alternatives and similar packages
Based on the "Deployment" category
Do you think we are missing an alternative of dockerize or a related project?
- Elixir >= 1.9
mix archive.install hex dockerize
1. Generate configurations from template
Run this command in your project directory:
2. Build your docker image
docker build, for example
docker build . # or optionally run with buildkit: # DOCKER_BUILDKIT=1 docker build .
Now you are free to do anything with the docker image built, either run it locally or host it on your infrastructures, e.g a Kubernete cluster.
For more information of
docker build, please refer to the official document.
Phoenix projects without assets
By default, it speculates if it's running in a phoenix project or not, by information from
Mix.Project.config(). So basically you have to do nothing specially. But if your phoenix project doesn't have assets, you could use the
--no-phoenix-assets parameter on generating the
Use different app name other than directory name
By default, it speculates app_name from the directory name. You can change it by:
mix dockerize.init --app my_app
use MIX_ENV other than
By default, it build the image with
MIX_ENV=prod. You can change
MIX_ENV value by providing it as an build argument:
docker build --build-arg mix_env=dev .
use HEX_MIRROR other than default (https://repo.hex.pm)
If you are in China, you may want to use some hex mirror:
docker build --build-arg hex_mirror_url=https://hexpm.upyun.com .
Docker images underhood
There are two base docker images used:
- A build-time environment
- Used for building the final minimum docker image to distribute.
- Suitable for CI/CD uses.