bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 396 forks source link

Sample Dockerfile doesn't work #722

Closed michelleran closed 4 years ago

michelleran commented 4 years ago

Steps to reproduce

  1. Clone https://github.com/wmnnd/elixir-docker-guide
  2. Copy the Dockerfile from https://hexdocs.pm/distillery/guides/working_with_docker.html
  3. Set SKIP_PHOENIX to true
  4. Add APP_NAME and APP_VSN parameters
  5. Run docker build -t APP_NAME_HERE .

This produces the error (Mix) The task "distillery.release" could not be found, so:

  1. Change the command to mix release (the --verbose flag is apparently not supported)
  2. Run docker build -t APP_NAME_HERE . This produces the following error:
** (Mix.Releases.Config.LoadError) could not load release config rel/config.exs
    ** (UndefinedFunctionError) function Mix.Config.Agent.start_link/0 is undefined (module Mix.Config.Agent is not available)
    Mix.Config.Agent.start_link()
    (stdlib) erl_eval.erl:677: :erl_eval.do_apply/6
    (stdlib) erl_eval.erl:446: :erl_eval.expr/5
    (stdlib) erl_eval.erl:126: :erl_eval.exprs/5
    (elixir) lib/code.ex:232: Code.eval_string/3
    (distillery) lib/mix/lib/releases/config/config.ex:281: Mix.Releases.Config.read_string!/1
    (distillery) lib/mix/lib/releases/config/config.ex:302: Mix.Releases.Config.read!/1
  1. Change the Elixir version from 1.7.2 to 1.9 (also update mix.exs to use the latest version of Distillery) and build again. mix release executes successfully, after which the following error is produced:
cp: can't stat '_build/prod/rel/APP_NAME_HERE/releases/0.1.0/APP_NAME_HERE.gz': No such file or directory

Description of issue

environment :prod do set include_erts: true set include_src: false set cookie: :"WQqW]YPYmjsoNxBuzQkoW2${8Pv~m{w>nH42hT>QqR~cE=qYdA@:0{RVr/i@>W" end

release :clock do set version: current_version(:clock) set applications: [ :runtime_tools ] end


- Is there documentation that says one thing, but Distillery does
  another? If so, please link the doc here so it can be updated if
  it's a documentation issue, or so that the fix can be based around
  what's documented.
https://hexdocs.pm/distillery/guides/working_with_docker.html
- If this is a runtime configuration issue, please also provide your config file 
  (with any sensitive information stripped of course). This is almost
  always necessary to understand why some configuration may not be working.

If you do not provide the above information and I need it to help troubleshoot, it may delay things significantly,
as I will have to ask you for all of these things anyway. Help me help you!
michelleran commented 4 years ago

Whoops, two things:

  1. Mixed up Distillery and Elixir 1.9's built-in release tools
  2. Used the wrong app name when building with Docker

It works now!