erlexec: cannot execute binary file

FROM centos:7 as build

SHELL ["/bin/bash", "-c"]

ENV LANG=en_US.UTF-8
# ENV HOME=/opt/build
ENV MIX_ENV prod

# Set the right versions
ENV ERLANG_VERSION latest
ENV ELIXIR_VERSION latest

RUN \
  yum update -y && \
  yum install -y epel-release && \
  yum install -y \
  autoconf \
  curl \
  gcc \
  gcc-c++ \
  git \
  glibc-devel \
  java-1.8.0-openjdk-devel \
  make \
  ncurses-devel \
  openssl-devel \
  unzip \
  wget \
  wxBase.x86_64

RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1 && \
  echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc

RUN source ~/.bashrc && \
  asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git && \
  asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git && \
  asdf install erlang $ERLANG_VERSION && \
  asdf install elixir $ELIXIR_VERSION && \
  asdf global erlang $ERLANG_VERSION && \
  asdf global elixir $ELIXIR_VERSION

# Install build tools
RUN source ~/.bashrc && mix do local.rebar --force, local.hex -if-missing --force

RUN mkdir /app
COPY ./ /app
WORKDIR /app

# Elixir release
RUN source ~/.bashrc && mix do deps.get --only prod, compile, release --overwrite

# Make a release archive
RUN tar -zcvf /app/release.tar.gz -C /app/_build/prod/rel/topo_master .