Having issue during docker build for Elixir app
└> docker build -t octopus_engine:1.0.0 .
[+] Building 24.2s (12/12) FINISHED docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 429B 0.0s
=> [internal] load metadata for docker.io/library/elixir:1.16-alpine 2.6s
=> [auth] library/elixir:pull token for registry-1.docker.io 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.2s
=> => transferring context: 23.02MB 0.2s
=> [1/7] FROM docker.io/library/elixir:1.16-alpine@sha256:a048fc41bd57ea566d4a6b985d7fc4529508a3c8cea12a9a10c 16.3s
=> => resolve docker.io/library/elixir:1.16-alpine@sha256:a048fc41bd57ea566d4a6b985d7fc4529508a3c8cea12a9a10c6 0.0s
=> => sha256:a048fc41bd57ea566d4a6b985d7fc4529508a3c8cea12a9a10c6fb0e6f563cc4 7.39kB / 7.39kB 0.0s
=> => sha256:ffecf4d1038498a3c09a74444f73b15f77694631b3e26027fd23505e424db0aa 1.54kB / 1.54kB 0.0s
=> => sha256:b79a31843cd6a0c6fd36cce750a676e3b9027b8d158feb12249041b85e905dab 5.50kB / 5.50kB 0.0s
=> => sha256:bca4290a96390d7a6fc6f2f9929370d06f8dfcacba591c76e3d5c5044e7f420c 3.35MB / 3.35MB 1.4s
=> => sha256:e5d176ad137694ea02867cbdc69b11fdff3a8aa1e4ac2e369aaad0c36e0a3ea4 45.59MB / 45.59MB 15.7s
=> => sha256:89381e95753af9e4fb0f75d0d6f25329abccb6a68314fe7eda4d894cd0bd1bb4 6.76MB / 6.76MB 6.8s
=> => extracting sha256:bca4290a96390d7a6fc6f2f9929370d06f8dfcacba591c76e3d5c5044e7f420c 0.1s
=> => extracting sha256:e5d176ad137694ea02867cbdc69b11fdff3a8aa1e4ac2e369aaad0c36e0a3ea4 0.5s
=> => extracting sha256:89381e95753af9e4fb0f75d0d6f25329abccb6a68314fe7eda4d894cd0bd1bb4 0.1s
=> [2/7] ADD . /workspace 0.1s
=> [3/7] WORKDIR /workspace 0.0s
=> [4/7] RUN rm -rf /workspace/_build 0.1s
=> [5/7] RUN mix local.hex --force 1.9s
=> [6/7] RUN mix local.rebar --force 1.8s
=> ERROR [7/7] RUN mix deps.get 1.3s
------
> [7/7] RUN mix deps.get:
1.052 Resolving Hex dependencies...
1.084 eheap_alloc: Cannot allocate 976733209832459912 bytes of memory (of type "heap_frag").
1.086
1.086 Crash dump is being written to: erl_crash.dump...beam/erl_term.h:1492:tag_val_def() Assertion failed: tag_val_def error
------
Dockerfile:19
--------------------
17 | RUN mix local.rebar --force
18 |
19 | >>> RUN mix deps.get
20 |
21 | CMD iex --name "octopus@${POD_IP}" --cookie ${ERLANG_COOKIE} -S mix
--------------------
ERROR: failed to solve: process "/bin/sh -c mix deps.get" did not complete successfully: exit code: 139
Cannot export crash dump from build, any info also appreciated.
Dockerfile:
FROM elixir:1.16-alpine
ARG MIX_ENV="dev"
ARG POD_IP="127.0.0.1"
ARG ERLANG_COOKIE="octopus_cookie"
ENV MIX_ENV=${MIX_ENV}
ENV POD_IP=${POD_IP}
ENV ERLANG_COOKIE=${ERLANG_COOKIE}
ADD . /workspace
WORKDIR /workspace
RUN rm -rf /workspace/_build
RUN mix local.hex --force
RUN mix local.rebar --force
RUN mix deps.get
CMD iex --name "octopus@${POD_IP}" --cookie ${ERLANG_COOKIE} -S mix
mix.exs:
defmodule OctopusEngine.MixProject do
use Mix.Project
def project do
[
app: :octopus_engine,
version: "1.0.0",
elixir: "~> 1.16",
start_permanent: Mix.env() == :prod,
deps: deps(),
releases: [
octopus_engine: [
include_executables_for: [:unix],
applications: [runtime_tools: :permanent]
]
]
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
mod: {OctopusEngine.Application, []},
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:k8s, "~> 2.0"},
{:libcluster, "~> 3.2"},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false}
]
end
end
Checked docker-desktop build for logs, but nothing special
memory limit is 16GB:
P.S. I m not trying to determine version of Elixir in particular version of Alpine image. Please read my question carefully before calling Close.
My question points to erl_crash which may happen in different versions of OTP in future - which can be useful for others.