【发布时间】:2017-09-20 11:42:30
【问题描述】:
我正在尝试将应用程序打包到 docker 容器中。它依赖于authable hex 包。
运行时:
docker build --tag "testing:0.1" --file Dockerfile .
...我收到以下编译错误:
== Compilation error on file lib/authable/repo.ex ==
** (ArgumentError) missing :adapter configuration in config :authable, Authable.Repo
lib/ecto/repo/supervisor.ex:50: Ecto.Repo.Supervisor.compile_config/2
lib/authable/repo.ex:6: (module)
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
could not compile dependency :authable, "mix compile" failed. You can recompile this dependency with "mix deps.compile authable", update it with "mix deps.update authable" or clean it with "mix deps.clean authable"
错误表明 Authable 在编译期间无法读取和初始化其repo 配置:
我觉得我缺少一些简单的东西,但我无法弄清楚它是什么。
这里有一个简单的 repo 来重现这个问题——https://github.com/gmile/test_authable_docker。
更新。明确指出只有在 docker 期间编译时才会出现错误(例如,在主机 macOS 上编译时一切正常)。
【问题讨论】:
-
你的项目对我来说编译得很好。
-
@JustinWood 你试过编译一个 docker 容器吗?
标签: docker elixir config elixir-mix