processone / docker-ejabberd

Set of ejabberd Docker images
94 stars 77 forks source link

mix: Building Docker image fails due to unavailable Erlang packages, e. g. `erlang-crypto (no such package)` #77

Closed paulmenzel closed 2 years ago

paulmenzel commented 2 years ago
$ sudo docker build -t ejabberd/mix .
Sending build context to Docker daemon  7.168kB
Step 1/6 : FROM alpine:3.14
 ---> 0a97eee8041e
Step 2/6 : LABEL maintainer="ProcessOne <contact@process-one.net>"       product="Ejabberd mix development environment"
 ---> Running in bd7fc6896765
Removing intermediate container bd7fc6896765
 ---> b87c58f9c9fc
Step 3/6 : RUN apk upgrade --update musl     && apk add build-base git zlib-dev openssl-dev yaml-dev expat-dev sqlite-dev     gd-dev jpeg-dev libpng-dev libwebp-dev autoconf automake bash     elixir erlang-crypto erlang-eunit erlang-mnesia erlang-erts erlang-hipe     erlang-tools erlang-os-mon erlang-syntax-tools erlang-parsetools     erlang-runtime-tools erlang-reltool erlang-odbc file curl     && rm -rf /var/cache/apk/*
 ---> Running in 8e56687c4901
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
OK: 6 MiB in 14 packages
ERROR: unable to select packages:
  erlang-crypto (no such package):
    required by: world[erlang-crypto]
  erlang-erts (no such package):
    required by: world[erlang-erts]
  erlang-eunit (no such package):
    required by: world[erlang-eunit]
  erlang-hipe (no such package):
    required by: world[erlang-hipe]
  erlang-mnesia (no such package):
    required by: world[erlang-mnesia]
  erlang-os-mon (no such package):
    required by: world[erlang-os-mon]
  erlang-parsetools (no such package):
    required by: world[erlang-parsetools]
  erlang-runtime-tools (no such package):
    required by: world[erlang-runtime-tools]
  erlang-syntax-tools (no such package):
    required by: world[erlang-syntax-tools]
  erlang-tools (no such package):
    required by: world[erlang-tools]
The command '/bin/sh -c apk upgrade --update musl     && apk add build-base git zlib-dev openssl-dev yaml-dev expat-dev sqlite-dev     gd-dev jpeg-dev libpng-dev libwebp-dev autoconf automake bash     elixir erlang-crypto erlang-eunit erlang-mnesia erlang-erts erlang-hipe     erlang-tools erlang-os-mon erlang-syntax-tools erlang-parsetools     erlang-runtime-tools erlang-reltool erlang-odbc file curl     && rm -rf /var/cache/apk/*' returned a non-zero code: 10
paulmenzel commented 2 years ago

erlang-crypto does not seem to be in Alpine since version 3.12.

paulmenzel commented 2 years ago

The subpackages were removed in Alpine commit 53aebeddaa (community/erlang: upgrade to 23.0 and fix circular deps).

badlop commented 2 years ago

Right, several erlang-* subpackages were incorporated into erlang package since Alpine 3.12, no need to install them individually. I'm improving the Github Action to test mix compilation, and later will review which of the remaining subpackages are really required.

badlop commented 2 years ago

Ah, thanks! The link you found mentions exactly what changed. After applying the corresponding changes https://github.com/badlop/docker-ejabberd/commit/96d6f0eb174bb20d0b74571a5010aa610cee8536 the mix image builds correctly, and the ecs based on it too https://github.com/badlop/docker-ejabberd/actions/runs/1692151131

paulmenzel commented 2 years ago

Yes, I locally did the same change independently, I was able to build everything myself. Maybe use

mix: Fix build with Alpine ≥ 3.12 by removing non-existent erlang subpackages

Many erlang subpackages were included into erlang since Alpine 3.12.

Resolves: https://github.com/processone/docker-ejabberd/issues/77