edib-tool/mix-edib
{ "createdAt": "2015-10-31T13:33:19Z", "defaultBranch": "master", "description": "A mix task for EDIB (elixir docker image builder)", "fullName": "edib-tool/mix-edib", "homepage": "https://hex.pm/packages/edib", "language": "Elixir", "name": "mix-edib", "pushedAt": "2023-08-27T12:05:36Z", "stargazersCount": 83, "topics": [ "builder", "container", "docker", "edib", "elixir", "image", "mix", "tool" ], "updatedAt": "2024-10-27T03:23:53Z", "url": "https://github.com/edib-tool/mix-edib"}EDIB mix task
Section titled “EDIB mix task”A mix task for EDIB (elixir docker image builder).
- [Installation]!(#installation)
- [Usage]!(#usage)
- [Help]!(#help)
- [Options]!(#options)
- [Name, prefix, tag]!(#name-prefix-tag)
- [Release strip and zip (EXPERIMENTAL)]!(#release-strip-and-zip-experimental)
- [Silent mode (quiet mode)]!(#silent-mode-quiet-mode)
- [Volume mappings]!(#volume-mappings)
- [Docker related]!(#docker-related)
- [Developer options]!(#developer-options)
EDIB creates a docker image of your application release.
Installation
Section titled “Installation”Just run this and confirm:
mix archive.install hex edibDon’t forget to add distillery to your project:
defp deps do [ {:distillery, "~> 1.1"}, ]endmix edibmix-edib will use the MIX_ENV environment variable to build the image.
MIX_ENV=staging mix edibWARNING: If MIX_ENV is not set EDIB will build the image for the prod environment.
mix help edibOptions
Section titled “Options”Name, prefix, tag
Section titled “Name, prefix, tag”Override the (repository) name of the docker image
mix edib --name <NAME>mix edib -n <NAME>Set only a specific prefix for the docker image name (default: local)
mix edib --prefix <PREFIX>mix edib -p <PREFIX>Set a specific tag for the docker image
mix edib --tag <TAG>mix edib -t <TAG>If --name and --prefix are given, the name option takes precedence
(prefix will be ignored).
Release strip and zip (EXPERIMENTAL)
Section titled “Release strip and zip (EXPERIMENTAL)”Following options use https://github.com/ntrepid8/ex_strip_zip in the edib-tool build environment.
All .beam files in a release can be stripped (mostly of debug information):
mix edib --stripmix edib -xMore technical information about stripping: http://erlang.org/doc/man/beam_lib.html#strip-1
All OTP applications can be bundled into archives (.ez files):
mix edib --zipmix edib -zWARNING: Do not use this if you have NIFs in your codebase or dependencies.
More technical information about “Loading of Code From Archive Files”: http://erlang.org/doc/man/code.html#id104826
Silent mode (quiet mode)
Section titled “Silent mode (quiet mode)”Silence build output of EDIB (will be logged to .edib.log instead)
mix edib --silentmix edib -sVolume mappings
Section titled “Volume mappings”Map additional volumes for use while building the release
mix edib --mapping <FROM>:<TO>[:<OPTION>]mix edib -m <FROM>:<TO>[:<OPTION>]For common cases there are some mapping shorthands:
Include the host user’s SSH keys for private GitHub repositories
mix edib --ssh-keysInclude host user’s .hex/packages cache
Can improve build times when the host’s .hex cache is available for every build run (tip for Travis CI: use their directory caching)
mix edib --hexInclude host user’s .npm package cache
Can improve build times when the host’s .npm cache is available for every build run (tip for Travis CI: use their directory caching)
mix edib --npmDocker related
Section titled “Docker related”Docker flags (mostly for debug purposes):
Run the build step privileged
mix edib --privilegedDo not remove intermediate containers on build runs
mix edib --no-rmDeveloper options
Section titled “Developer options”Select edib-tool docker image (complete repo + version)
mix edib --edib edib/edib-tool:1.5.2mix edib -e edib/edib-tool:1.5.2