# DockerDistiller
This package uses Distillery and Docker to create containerized
builds of Elixir apps that are small and nimble.
To that end, it uses Alpine Linux as a base container OS and
[Marlus Saraiva's Great Work](https://github.com/msaraiva/alpine-erlang) on
keeping current versions of Erlang and Elixir for Alpine/Docker.
## Installation/Use
If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:
1. Add `docker_distiller` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:docker_distiller, "~> 0.1.0"}]
end
```
1. Run `mix release.init` to get a Distillery config setup. See the [Distillery
Docs](https://hexdocs.pm/distillery/getting-started.html) for details.
1. Add a target `docker_repo` setting to your application.
1. Add a template Dockerfile called `Dockerfile.deploy.eex`. This template will get
stuff injected from the build and then written as `Dockerfile`, overwriting
existing things. Currently only one thing is sent to the template:
* `dist_tar`: the path of the distribution tarball.
An example minimal template:
```
FROM msaraiva/erlang:18.3
ADD <%= dist_tar %> /webadminapistub
CMD /yourapp/bin/yourapp foreground
```
Note that even though the distribution tar contains Erlang, there are packages that
Erlang needs (like the libncurses) so building from a basic Alpine image will most
likely not work.
1. Run `mix publish` to build a release and publish it.