Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON and Docker #43

Closed
mvbaffa opened this issue Nov 10, 2016 · 3 comments
Closed

JSON and Docker #43

mvbaffa opened this issue Nov 10, 2016 · 3 comments

Comments

@mvbaffa
Copy link

mvbaffa commented Nov 10, 2016

Hi,

I am trying to generate a Docker container for an application that uses JSON. The Dockefile is basic:

FROM bitwalker/alpine-elixir:1.3.4

EXPOSE 4000
ENV PORT=4000 \
    MIX_ENV=prod

COPY . .
RUN \
    mix do deps.get, deps.compile && \
    mix do compile, release --verbose --env=prod && \
    mkdir -p /opt/myapp/log && \
    cp rel/myapp/releases/0.1.0/myapp.tar.gz /opt/myapp/ && \
    cd /opt/myapp && \
    tar -xzf myapp.tar.gz && \
    rm myapp.tar.gz && \
    rm -rf /opt/app/* && \
    chmod -R 777 /opt/app && \
    chmod -R 777 /opt/myapp

WORKDIR /opt/myapp

CMD ./bin/myapp foreground

When building the container There is an error in the json Dependency. This does not occur when I get or compile in my Red Hat Studio. It generates and the application runs properly.

I have already tried mix deps.compile json, update and clean

could not compile dependency :json, "mix compile" failed. You can recompile this dependency with "mix deps.compile json", update it with "mix deps.update json" or clean it with "mix deps.clean json"                                                                                                                                                      

20:15:39.606 [error] Native loading of /opt/app/_build/prod/lib/json/ebin/Elixir.JSON.beam failed: {:EXIT,
 {:badarg,
  [{:hipe_bifs, :patch_call, [1077937026, 140607107223148, []], []},
   {:hipe_unified_loader, :patch_call_insn, 3,
    [file: 'hipe_unified_loader.erl', line: 520]},
   {:hipe_unified_loader, :patch_bif_call_list, 4,
    [file: 'hipe_unified_loader.erl', line: 505]},
   {:hipe_unified_loader, :patch_call, 5,
    [file: 'hipe_unified_loader.erl', line: 496]},
   {:hipe_unified_loader, :patch, 5,
    [file: 'hipe_unified_loader.erl', line: 471]},
   {:hipe_unified_loader, :load_common, 5,
    [file: 'hipe_unified_loader.erl', line: 240]},
   {:hipe_unified_loader, :load_native_code, 3,
    [file: 'hipe_unified_loader.erl', line: 111]},
   {:code_server, :try_load_module_2, 6,
    [file: 'code_server.erl', line: 1111]}]}}

Can you help me?

Thanks

@cblage
Copy link
Owner

cblage commented Dec 8, 2016

Sorry for the delay, I might try releasing a version without native compiling. Were you able to solve it?

@wictory
Copy link

wictory commented Mar 20, 2017

I do also get a similar error.
error.txt

$ iex --version
Erlang/OTP 19 [erts-8.2.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

IEx 1.4.2

Oh, and I'm on Fedora 25 and not in Docker.

@cblage
Copy link
Owner

cblage commented May 23, 2017

@wictory @mvbaffa version 1.0.2 should fix the issue: https://github.com/cblage/elixir-json/releases/tag/v1.0.2

@cblage cblage closed this as completed May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants