sc4224
I’m running Phoenix 1.3 with Elixir 1.6 and Erlang OTP 20 in a docker container.
I use comeonin ~> 4.0 and bcrypt_elixir ~> 1.0
When I try to call the function Comeonin.Bcrypt.hashpwsalt(WITH_MY_PASSWORD), the error returned is: function Bcrypt.Base.gensalt_nif/3 is undefined (module Bcrypt.Base is not available)
I’ve read other forums and they all point to the fact that Bcrypt 1.0 is only compatible with erlang 20. So I don’t really know what the issue is here.
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
NobbZ
Are you able to share your
Dockerfileand yourmix.exs(thedepspart at least)?sc4224
Here is the dockerfile for my phoenix app
# base image elixer to start with
FROM elixir:1.6
NobbZ
Why do you
cdintodeps/bcrypt_elixirand runmake clean && makethere? That feels wrong…My assumption is, that you do this, because the deps folder from your host is put into your docker container during
COPY ./my_app /appand therefore you have build artifacts which do not match the system in the container and you try to “repair” this by force rebuilding in docker? This probably doesn’t work, as there might still old artifacts for the wrong architecture remain in the also copyed_buildfolder.Instead you should properly
.dockerignorethedepsand_buildfolders to really be sure, that nothing wrong slips in.sc4224
this is the reason why i did it:
https://github.com/riverrun/comeonin/issues/64
if I ignore my_app/deps, does that mean that i can’t run mix deps.get in my dockerfile anymore? What do i do then?
NobbZ
No, it actually means that you have to do it. Without ignoring it, the
depsand_buildfolder from your host will be copied over into the container, wasting space in the layer is one of the downsides, the other is, that they might contain artifacts that are incompatible with the containerized erlang and elixir.Also the linked issue does not affect a docker container, at least not if it is build correctly. As a correctly built docker container should never see old artifacts in
depsand_buildas they never should exist on the container prior tomix deps.getandmix deps.compile/mix compile.The ticket above really only affects those that compiled a NIF on OTP N, update erlang and get back to that project, but now have OTP N+1. Then the NIF wouldn’t be recognized, and in that issue a nasty workaround was shown. The proper way to handle this is actually
mix do deps.clean bcrypt_elixir, deps.build.But to be honest, my general advise is to simply
rm -rf deps _build; mix do deps.get, deps.compileafter updating Erlang or Elxir. Just to make sure that all libraries used use the latest enhencements of the language.sc4224
I don’t understand, I removed both deps and _build folders. Does the command
RUN mix deps.get && mix deps.compileget included in the dockerfile or not. When I rundocker-compose buildthendocker-compose up, Because I put deps and _build in the dockerignore file I get this error:Or do I run
mix deps.get and mix deps.compilein the terminal first before runningdocker-compose buildand then subsequentlydocker-compose up?Either way, I still get the same error and it doesn’t work
Here is my repository you can check it out and see what I’m doing wrong, I have two dockerfiles since I want to run a golang microservice along with my web server:
https://github.com/sc4224/genesys
NobbZ
Of course it does, it is needed to fetch and compile the dependencies.
sc4224
ok so i still get the error saying that the dependency is not available
NobbZ
Which dependency is not available? When do you get that error message? Do you get any errors or messages during building container?
sc4224
The errors are the errors mentioned above. This happens when I run docker-compose build. Take a look at my repository above, is it the fact that I am putting too many services in one container, possibly giving rise to errors when I reference folder paths?