hexpm/elixir Ubuntu/Debian images don't support ICMP protocol while Alpine ones do
The test consists in performing the following commands:
$ docker run --rm -ti hexpm/elixir:1.13.2-erlang-24.2.1-ubuntu-focal-20211006 sh
# iex
Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
Interactive Elixir (1.13.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :socket.open(:inet, :raw, :icmp)
{:error, {:invalid, {:protocol, :icmp}}}
and repeating for each Debian/Ubuntu images available.
Then if you perform the same for Alpine Linux, it actually works:
$ docker run --rm -ti hexpm/elixir-arm64:1.13.2-erlang-24.2.1-alpine-3.15.0 sh
/ # iex
Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
Interactive Elixir (1.13.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :socket.open(:inet, :raw, :icmp)
{:ok, {:"$socket", #Reference<0.4054872251.4063100932.145697>}}
The problem seems to be related to some missing package at build time. Reference seems to be here: https://github.com/erlang/otp/blob/aa7f201ac2405ef6bf25d3111934f89dc3e23b73/erts/emulator/nifs/common/socket_nif.c#L169. The definition HAVE_LINUX_ERRQUEUE_H seems to be missing during build time.
Do you know which package is missing? If so, could you please send a PR?
I did some tests and looks like we're missing netbase package to get it work, but I can't reproduce the error in all debian/ubuntu images, for example, in the image hexpm/erlang:22.2-ubuntu-bionic-20200219 it works