erlang / docker-erlang-otp

the Official Erlang OTP image on Docker Hub

Home Page:https://hub.docker.com/_/erlang/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alpine OTP 21 image missing sftpd files

krgn opened this issue · comments

HI,

I'm trying to build an application which relies on

/usr/local/lib/erlang/lib/ssh-4.7.6/src/ssh_sftpd.erl

to be present. However, in the alpine builds, that file is unfortunately missing. This is the error I'm getting trying to build my app:

== Compilation error in file lib/channel.ex ==
** (RuntimeError) error parsing file /usr/local/lib/erlang/lib/ssh-4.7.6/src/ssh_sftpd.erl, got: {:error, :enoent}
    (elixir) lib/record/extractor.ex:84: Record.Extractor.read_file/2
    (elixir) lib/record/extractor.ex:50: Record.Extractor.extract_record/2
    lib/channel.ex:8: (module)
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
could not compile dependency :sftpd, "mix compile" failed. You can recompile this dependency with "mix deps.compile sftpd", update it with "mix deps.update sftpd" or clean it with "mix deps.clean sftpd"

The base image I'm using is elixir:1.8.1-alpine which in turn depends on elixir:21-alpine.

Thanks for any hints.

All source files are stripped from the image. So if you need the source you will have to build your own image.

I'm not sure what the record extractor is doing, but it could be possible to patch it to not need the source files but instead use the AST in the beam files debug chunk.

Thanks for your reply. I might be able to manually maintain that file somewhere else as a workaround. I do get the size argument for stripping the sources, but its a bit of an unexpected difference to, say, the debian based image, where those files are shipped as part of the image.

commented

I'm trying to build an application which relies on
/usr/local/lib/erlang/lib/ssh-4.7.6/src/ssh_sftpd.erl

Could you describe some more why does this app need to read erl source code? I've seen some Erlang app is including .hrl header files for record definition, like C based library projects have header files and .c files, but in the *-devel packages usually only have the headers files, and users are expected to include its header files only