processone / docker-ejabberd

Set of ejabberd Docker images
95 stars 77 forks source link

Build fails with `(Mix) You're trying to run :ejabberd on Elixir v1.9.2 but it has declared in its mix.exs file it supports only Elixir ~> 1.10` #85

Closed paulmenzel closed 2 years ago

paulmenzel commented 2 years ago

With the image

ejabberd/mix                        latest              6eaa7aedcda9        4 months ago        293MB

and current master branch (commit 2cdfd7d (Join mix building into main tests, it just adds a few seconds )), sudo ./build.sh latest results in:

Step 12/32 : RUN MIX_ENV=prod mix release
 ---> Running in 464cc3b499b0
ERROR: To build releases, Elixir 1.10.0 or higher is required.
** (Mix) You're trying to run :ejabberd on Elixir v1.9.2 but it has declared in its mix.exs file it supports only Elixir ~> 1.10
paulmenzel commented 2 years ago

The base imae alpine:3.14 is used, and I am confused, as that should have elixir 1.12-rc0.

badlop commented 2 years ago

Docker Hub says that the mix image was updated 5 months ago, but maybe the layer that downloaded the dependencies was cached from an earlier build?

If you modify the entrypoint and get in the shell, it says:

/ # iex
Erlang/OTP 22 [erts-10.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]

Interactive Elixir (1.9.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 

Quite obviously, this image needs to be run from scratch. And the ejabberd/ecs too. The next ejabberd release is coming soon, and this is a good chance to update the mix image.

By the way, there's an alternative container image for ejabberd, published in: https://github.com/processone/ejabberd/pkgs/container/ejabberd

RIght now only the "master" tag is built using that new Dockerfile.

The source of that container is hosted in https://github.com/processone/ejabberd/tree/master/.github/container

paulmenzel commented 2 years ago

Indeed:

$ sudo docker run -ti --entrypoint sh ejabberd/mix
/ # elixir --version
Erlang/OTP 22 [erts-10.5] [source] [64-bit] [smp:24:24] [ds:24:24:10] [async-threads:1]

Elixir 1.9.2 (compiled with Erlang/OTP 22)
/ # more /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.3
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
/ # apk info elixir
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.11/main: No such file or directory
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.11/community: No such file or directory
elixir-1.9.2-r0 description:
Elixir is a dynamic, functional language designed for building scalable and maintainable applications

elixir-1.9.2-r0 webpage:
https://elixir-lang.org/

elixir-1.9.2-r0 installed size:
6459392

But:

/ # apk update     
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
v3.11.13-8-gaf7d80ff31 [http://dl-cdn.alpinelinux.org/alpine/v3.11/main]
v3.11.11-124-gf2729ece5a [http://dl-cdn.alpinelinux.org/alpine/v3.11/community]
OK: 11275 distinct packages available
/ # apk upgrade
OK: 289 MiB in 98 packages
/ # apk version elixir
Installed:                                Available:
elixir-1.9.2-r0                         = 1.9.2-r0
paulmenzel commented 2 years ago

So, ejabberd/mix was built on top of alpine:3.11 and not alpine:3.14, done at the end of last year in commit https://github.com/processone/docker-ejabberd/commit/bd19f3e33d50394e0c7330ce38862eaf7283da8f, so before the four month old ejabberd/mix image was built.

badlop commented 2 years ago

The ejabberd/mix has been updated right now. I have checked it includes erlang 24 and elixir 1.12.

The ejabberd/ecs has also been updated with the 22.05 release (not yet announced)