Popularity
1.8
Declining
Activity
6.3
Declining
11
1
0

Description

Dockerize is an Elixir package that helps you create Docker images from Elixir projects.

Monthly Downloads: 3
Programming language: Elixir
License: MIT License

dockerize alternatives and similar packages

Based on the "Deployment" category

Do you think we are missing an alternative of dockerize or a related project?

Add another 'Deployment' Package

README

Dockerize is an Elixir package that helps you create Docker images from Elixir projects.

Prerequirements

  • Elixir >= 1.9

Install

mix archive.install hex dockerize

Getting Started

1. Generate configurations from template

Run this command in your project directory:

mix dockerize.init

2. Build your docker image

just run docker build, for example

docker build .

Done!

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.

Customizing

For Phoenix Projects

Modify the generated Dockerfile. Follow the instructions in it.

use different app name other than directory name

By default, it speculates guess app_name from the directory name. You can change it by:

mix dockerize.init --app my_app

use MIX_ENV other than prod

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:

  • elixir-runner

    • A final runtime environment for running your release.
    • This image is based on Alpine which is very small.
    • There are some useful utility tools installed out of the box.
  • elixir-builder

    • A build-time environment
    • Used for building the final minimum docker image to distribute.
    • Suitable for CI/CD uses.