Sample Dockerfile doesn't work
michelleran opened this issue · 1 comments
michelleran commented
Steps to reproduce
- Clone https://github.com/wmnnd/elixir-docker-guide
- Copy the Dockerfile from https://hexdocs.pm/distillery/guides/working_with_docker.html
- Set
SKIP_PHOENIX
to true - Add
APP_NAME
andAPP_VSN
parameters - Run
docker build -t APP_NAME_HERE .
This produces the error (Mix) The task "distillery.release" could not be found
, so:
- Change the command to
mix release
(the--verbose
flag is apparently not supported) - 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
- 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
- What are the expected results?
A successful build. It seems like the issue is that Distillery generates a .rel file, not a .tar.gz file. - What version of Distillery?
1.5.2 before step 8 -> 2.1.1 - What OS, Erlang/Elixir versions are you seeing this issue on?
OS X 10.15.1, Elixir 1.5 before step 8 -> 1.9 - If possible, also provide your
rel/config.exs
, as it is often
my first troubleshooting question, and you'll save us both time :)
Unchanged from the default config file:
use Mix.Releases.Config,
default_release: :default,
default_environment: Mix.env()
environment :prod do
set include_erts: true
set include_src: false
set cookie: :"WQqW]YPYmjsoNxBuzQ`koW2${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
Whoops, two things:
- Mixed up Distillery and Elixir 1.9's built-in release tools
- Used the wrong app name when building with Docker
It works now!