JSON and Docker
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
Sorry for the delay, I might try releasing a version without native compiling. Were you able to solve it?
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.
@wictory @mvbaffa version 1.0.2 should fix the issue: https://github.com/cblage/elixir-json/releases/tag/v1.0.2