Skip to content

mix deps compiled in Docker image need to be re-compiled when starting container #5130

@hisapy

Description

@hisapy

This might be a possible minor bug.

Environment

  • Elixir version (elixir -v): Elixir 1.3.1
  • Operating system: Ubuntu 16.04 (on a Docker container)

Current behavior

I have a Dockerfile with an instruction to compile Mix deps. Everything works fine when you build the Docker image. However the first time you start a container with the image and run mix phoenix.server or iex -S mix.phoenix.server everything compiles again. This process can take approximately 3 minutes. After this first compilation on the container, whenever you restart the container everything is compiled and working as expected.

Although the _build directory contains all the builds you would expect to be in there, the first time you start the container mix deps output is like the following:

* connection (Hex package) (mix)
  locked at 1.0.4 (connection) a1cae722
  the dependency build is outdated, please run "mix deps.compile"
* fs (Hex package) (rebar)
  locked at 0.9.2 (fs) ed17036c
  the dependency build is outdated, please run "mix deps.compile"
* gettext (Hex package) (mix)
  locked at 0.11.0 (gettext) 80c1dd42
  the dependency build is outdated, please run "mix deps.compile"
* absinthe (Hex package) (mix)
  locked at 1.1.8 (absinthe) b5563ca1
  the dependency build is outdated, please run "mix deps.compile"
* ranch (Hex package) (rebar)
  locked at 1.2.1 (ranch) a6fb992c
  the dependency build is outdated, please run "mix deps.compile"
* poolboy (Hex package) (rebar)
  locked at 1.5.1 (poolboy) 6b461639
  the dependency build is outdated, please run "mix deps.compile"
* decimal (Hex package) (mix)
  locked at 1.1.2 (decimal) 79a769d4
  the dependency build is outdated, please run "mix deps.compile"
* poison (Hex package) (mix)
  locked at 2.2.0 (poison) 4763b69a
  the dependency build is outdated, please run "mix deps.compile"
* db_connection (Hex package) (mix)
  locked at 1.0.0-rc.4 (db_connection) fad1f772
  the dependency build is outdated, please run "mix deps.compile"
* phoenix_pubsub (Hex package) (mix)
  locked at 1.0.0 (phoenix_pubsub) c31af4be
  the dependency build is outdated, please run "mix deps.compile"
* cowlib (Hex package) (rebar)
  locked at 1.0.2 (cowlib) 9d769a1d
  the dependency build is outdated, please run "mix deps.compile"
* cowboy (Hex package) (rebar)
  locked at 1.0.4 (cowboy) a324a8df
  the dependency build is outdated, please run "mix deps.compile"
* plug (Hex package) (mix)
  locked at 1.1.6 (plug) 8927e402
  the dependency build is outdated, please run "mix deps.compile"
* absinthe_plug (Hex package) (mix)
  locked at 1.1.3 (absinthe_plug) 6abd17e9
  the dependency build is outdated, please run "mix deps.compile"
* phoenix_html (Hex package) (mix)
  locked at 2.6.2 (phoenix_html) 944a5e58
  the dependency build is outdated, please run "mix deps.compile"
* phoenix (Hex package) (mix)
  locked at 1.2.0 (phoenix) 1bdeb99c
  the dependency build is outdated, please run "mix deps.compile"
* phoenix_live_reload (Hex package) (mix)
  locked at 1.0.5 (phoenix_live_reload) 829218c4
  the dependency build is outdated, please run "mix deps.compile"
* postgrex (Hex package) (mix)
  locked at 0.11.2 (postgrex) 139755c1
  the dependency build is outdated, please run "mix deps.compile"
* ecto (Hex package) (mix)
  locked at 2.0.2 (ecto) b02331c1
  the dependency build is outdated, please run "mix deps.compile"
* absinthe_relay (Hex package) (mix)
  locked at 0.9.4 (absinthe_relay) 72a59b7a
  the dependency build is outdated, please run "mix deps.compile"
* phoenix_ecto (Hex package) (mix)
  locked at 3.0.0 (phoenix_ecto) b947aaf0
  the dependency build is outdated, please run "mix deps.compile

Expected behavior

Based on the Dockerfile instructions, I expect deps to be properly compiled from the first time the container is started, thus mix deps output from the first time I get in the container should be:

* connection 1.0.4 (Hex package) (mix)
  locked at 1.0.4 (connection) a1cae722
  ok
* fs 0.9.1 (Hex package) (rebar)
  locked at 0.9.2 (fs) ed17036c
  ok
* gettext 0.11.0 (Hex package) (mix)
  locked at 0.11.0 (gettext) 80c1dd42
  ok
* absinthe 1.1.8 (Hex package) (mix)
  locked at 1.1.8 (absinthe) b5563ca1
  ok
* ranch 1.2.1 (Hex package) (rebar)
  locked at 1.2.1 (ranch) a6fb992c
  ok
* poolboy 1.5.1 (Hex package) (rebar)
  locked at 1.5.1 (poolboy) 6b461639
  ok
* decimal 1.1.2 (Hex package) (mix)
  locked at 1.1.2 (decimal) 79a769d4
  ok
* poison 2.2.0 (Hex package) (mix)
  locked at 2.2.0 (poison) 4763b69a
  ok
* db_connection 1.0.0-rc.4 (Hex package) (mix)
  locked at 1.0.0-rc.4 (db_connection) fad1f772
  ok
* phoenix_pubsub 1.0.0 (Hex package) (mix)
  locked at 1.0.0 (phoenix_pubsub) c31af4be
  ok
* cowlib 1.0.2 (Hex package) (rebar)
  locked at 1.0.2 (cowlib) 9d769a1d
  ok
* cowboy 1.0.4 (Hex package) (rebar)
  locked at 1.0.4 (cowboy) a324a8df
  ok
* plug 1.1.6 (Hex package) (mix)
  locked at 1.1.6 (plug) 8927e402
  ok
* absinthe_plug 1.1.3 (Hex package) (mix)
  locked at 1.1.3 (absinthe_plug) 6abd17e9
  ok
* phoenix_html 2.6.2 (Hex package) (mix)
  locked at 2.6.2 (phoenix_html) 944a5e58
  ok
* phoenix 1.2.0 (Hex package) (mix)
  locked at 1.2.0 (phoenix) 1bdeb99c
  ok
* phoenix_live_reload 1.0.5 (Hex package) (mix)
  locked at 1.0.5 (phoenix_live_reload) 829218c4
  ok
* postgrex 0.11.2 (Hex package) (mix)
  locked at 0.11.2 (postgrex) 139755c1
  ok
* ecto 2.0.2 (Hex package) (mix)
  locked at 2.0.2 (ecto) b02331c1
  ok
* absinthe_relay 0.9.4 (Hex package) (mix)
  locked at 0.9.4 (absinthe_relay) 72a59b7a
  ok
* phoenix_ecto 3.0.0 (Hex package) (mix)
  locked at 3.0.0 (phoenix_ecto) b947aaf0
  ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions