alpine-erlang icon indicating copy to clipboard operation
alpine-erlang copied to clipboard

"Unable to load crypto library." on docker run

Open yuchunc opened this issue 9 years ago • 4 comments

Hi! Thank you so much for the Dockerfile template!! It was awesome to get my first image build following the hello_phoenix example!

However, when I attempted to do docker run on the image. I came across this error.

{error_logger,{{2016,2,17},{7,15,51}},"Unable to load crypto library. Failed with error:~n\"~p,
~s\"~nOpenSSL might not be installed on this system.~n",[load_failed,"Failed to load NIF library: 
'Error loading shared library /content_ui/lib/crypto-3.6.1/priv/lib/crypto.so: Exec format error'"]}

I can't seem to get pass this error, even with building the image from alpine. If it is not too much hassle, would you mind giving me some directions on how to resolve this issue?

yuchunc avatar Feb 17 '16 07:02 yuchunc

I also get this! Even ensuring that there was a rel/relx.config file with correct contents.

mrluc avatar Feb 17 '16 18:02 mrluc

Just saw the problem. I'll take a look at it today. Thanks for reporting it.

msaraiva avatar Feb 18 '16 11:02 msaraiva

Please try this:

  • Make sure you have the rel/relx.config file as described in Phoenix + Elixir Release Manager (exrm)
  • Clean your rel/<your_project> folder. This is necessary because in case you have run MIX_ENV=prod mix release without rel/relx.config, you probably still have files specific to your build architecture. In this case you still have the /content_ui/lib/crypto-3.6.1/priv/lib/crypto.so file build for your build environment, not for Alpine Linux.

msaraiva avatar Feb 21 '16 22:02 msaraiva

I continued to have issues -- but in the end I just went back to what I had been doing, which was building in Alpine linux with your helpful elixirgcc image, using separate Dockerfile.build/Dockerfile files for building and running.

mrluc avatar Feb 22 '16 19:02 mrluc