mix_docker icon indicating copy to clipboard operation
mix_docker copied to clipboard

Umbrella App mix docker.build failed

Open kloktech-mark opened this issue 8 years ago • 5 comments

Following error displayed when running mix docker.build. I am not sure if this is related to #15 where app and version needs to specified, the referenced distillery's issue, bitwalker/distillery#201

** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1 (elixir) lib/io.ex:445: IO.chardata_to_string(nil) (elixir) lib/path.ex:475: Path.do_join/3 (elixir) lib/path.ex:470: Path.join/2 (elixir) lib/path.ex:450: Path.join/1 (distillery) lib/mix/lib/releases/archiver.ex:31: Mix.Releases.Archiver.make_tar/1 (distillery) lib/mix/lib/releases/archiver.ex:17: Mix.Releases.Archiver.archive/1 (distillery) lib/distillery/tasks/release.ex:113: Mix.Tasks.Release.run/1 (mix) lib/mix/task.ex:294: Mix.Task.run_task/3

The command '/bin/sh -c mix release --env=prod --verbose' returned a non-zero code: 1 ** (MatchError) no match of right hand side value: {%IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}, 1} lib/mix_docker.ex:153: MixDocker.system!/2 lib/mix_docker.ex:123: MixDocker.with_dockerfile/2 lib/mix_docker.ex:18: MixDocker.build/1 (mix) lib/mix/task.ex:294: Mix.Task.run_task/3 (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2

kloktech-mark avatar Mar 15 '17 15:03 kloktech-mark

@linmark333 Please try current master (f5c504fd)

/cc @lpil this might also solve your umbrella issues

teamon avatar Apr 04 '17 19:04 teamon

@teamon I've also run into this problem in my umbrella app, and have retried using master. I get the same error from master.

Output:

The command '/bin/sh -c mix release --env=prod --verbose' returned a non-zero code: 1
** (MatchError) no match of right hand side value: {%IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}, 1}
    lib/mix_docker.ex:180: MixDocker.system!/2
    lib/mix_docker.ex:150: MixDocker.with_dockerfile/2
    lib/mix_docker.ex:20: MixDocker.build/1
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2

Edit

To provide a bit more information, above that error and stack trace, I get some other errors:

Step 12/12 : RUN mix release --env=prod --verbose
 ---> Running in fac10e2b1e53
fatal: Not a git repository (or any of the parent directories): .git

That Not a git repository error repeats a number of times. Finally, some dependency errors which is really weird to me…

Unchecked dependencies for environment prod:
* amqp (Hex package)
  the dependency is not available, run "mix deps.get"

It lists all my app's dependencies there, not just a couple.

These errors only happen when running a mix docker.build

jeremytregunna avatar Apr 20 '17 16:04 jeremytregunna

It's because in the Dockerfile.build, the mix.exs and mix.lock is copied, but I believe this won't work for an umbrella app, as this will require apps etc as well?

joshuataylor avatar May 11 '17 14:05 joshuataylor

I manually copy all the apps as well. I don't recall how I worked around this issue, but I since have. Not helpful I know, so my apologies about that.

EDIT: To clarify, I copy the mix.exs's from the apps, and their respective configs.

jeremytregunna avatar May 11 '17 14:05 jeremytregunna

@jeremytregunna yeah, did the same and works. Testing now, this is awesome :)

joshuataylor avatar May 11 '17 14:05 joshuataylor