2017-04-23 10 views
0

私はドッカーコンテナにアプリケーションをパッケージしようとしています。それはauthable 16進パッケージに依存しています。コンパイル時に依存関係がその設定を見ることができません

実行している場合:

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設定を初期化&を読み取ることができませんでした示しています

  1. authable/repo.ex
  2. config.exs

私が欠けているという単純な何かがありますような気がしますが、私はそれが私たちのものを把握することはできません。

問題を再現する簡単なレポはここにあります - https://github.com/gmile/test_authable_docker

更新。ドッカーでコンパイルするときにのみエラーが発生することが明らかになりました(たとえば、ホストmacOSでコンパイルするとすべて問題ありません)。

+0

あなたのプロジェクトは、私のためにうまくコンパイル。 –

+0

@ JustinWoodドッキング用のコンテナをコンパイルしようとしましたか? – gmile

答えて

1

mix deps.compileを実行しようとしたときにconfig/config.exsがまだ利用できないDockerfileの問題があります。

オリジナルDockerfile内容:

# Install and compile project dependencies 
COPY mix.* ./ 

RUN mix deps.get 
RUN mix deps.compile 
RUN mix ecto.create 
RUN mix ecto.migrate -r Authable.Repo 

# Add project sources 
COPY . . 

mix compileを行う前にソースをコピーするには、これを変更するには、この問題を解決:

.... 
RUN mix deps.get 

# Add project sources 
COPY . . 

RUN mix deps.compile 
... 
+0

ありがとう、Navin!それは私の間違ったミスでした – gmile

関連する問題