Recruitee/mix_docker

docker.build fails

Closed this issue · 3 comments

Unsatisfiable constraints:

$ mix docker.build
warning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
/home/mmartin/git/exmailer_worker/deps/dtt/mix.exs:10

11:47:45.853 [debug] $ docker build -f Dockerfile.build -t exmailer_worker:build .
Sending build context to Docker daemon 221.2 kB
Step 1/12 : FROM bitwalker/alpine-erlang:19.2.1b
19.2.1b: Pulling from bitwalker/alpine-erlang
0a8490d0dfd3: Pulling fs layer
68d9b106c1a1: Pulling fs layer
88a28439f8b3: Pulling fs layer
68d9b106c1a1: Download complete
0a8490d0dfd3: Verifying Checksum
0a8490d0dfd3: Download complete
0a8490d0dfd3: Pull complete
68d9b106c1a1: Pull complete
88a28439f8b3: Verifying Checksum
88a28439f8b3: Download complete
88a28439f8b3: Pull complete
Digest: sha256:8613d6b43bd6dba5eba50d49145e377cb52b63cf00c7b32bf8fa341566509b89
Status: Downloaded newer image for bitwalker/alpine-erlang:19.2.1b
---> b11046ea4327
Step 2/12 : ENV HOME /opt/app/ TERM xterm
---> Running in 3e7316d3c954
---> b03edb892662
Removing intermediate container 3e7316d3c954
Step 3/12 : RUN echo "@edge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && apk update && apk --no-cache --update add git make g++ elixir@edge=1.4.2-r0 && rm -rf /var/cache/apk/*
---> Running in 70d5524d2645
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://nl.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
v3.5.2-111-gb17579f3fe [http://dl-cdn.alpinelinux.org/alpine/v3.5/main]
v3.5.2-110-gd9e62397fb [http://dl-cdn.alpinelinux.org/alpine/v3.5/community]
v3.6.0-1200-gdc90c47f0c [http://dl-cdn.alpinelinux.org/alpine/edge/main]
v3.6.0-1198-g8662f54966 [http://nl.alpinelinux.org/alpine/edge/community]
OK: 16470 distinct packages available
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://nl.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://nl.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
elixir-1.3.4-r0:
breaks: world[elixir=1.4.2-r0]
The command '/bin/sh -c echo "@edge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && apk update && apk --no-cache --update add git make g++ elixir@edge=1.4.2-r0 && rm -rf /var/cache/apk/*' 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:179: MixDocker.system!/2
lib/mix_docker.ex:149: 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

Getting the exact same error.

The problem is in the repository (@edge) in dockerfile.build.. This only has the latest version of elixir that today is 1.4.4.
Solutions:

  • Modify the elixir version to 1.4.4 in dockerfile.build.
  • Change the repository to one that has more elixir versions.

Modifying the elixir version in Dockerfile.build to 1.4.4 fixed the problem. Thanks!