Skip to content

Instantly share code, notes, and snippets.

@waisbrot
Created November 23, 2015 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waisbrot/3415d53f7c0b66a36013 to your computer and use it in GitHub Desktop.
Save waisbrot/3415d53f7c0b66a36013 to your computer and use it in GitHub Desktop.
Erlang in Docker
FROM <<<private amazon-linux base-image>>>
ENV PATH=/opt/erlang/bin:/opt/rebar/bin:$PATH
COPY install.bash /tmp/
RUN ["/tmp/install.bash"]
FROM whoop/erlang-base:18.1
MAINTAINER Nathaniel Waisbrot <waisbrot@whoop.com>
WORKDIR ${WHOOP_HOME}/my_project
CMD ["./run.bash"]
COPY rebar.config rebar.lock ./
RUN rebar3 update && rebar3 compile
COPY . .
RUN rebar3 release
#!/bin/bash -ex
ERL_VSN=18.1
yum clean all
yum install -q -y gcc ncurses-devel perl openssl-devel openssl git
cd /tmp
curl -O https://raw.githubusercontent.com/yrashk/kerl/master/kerl
chmod a+x kerl
if ./kerl build ${ERL_VSN} ${ERL_VSN}; then
./kerl install ${ERL_VSN} /opt/erlang-${ERL_VSN}
ln -s /opt/erlang-${ERL_VSN} /opt/erlang
echo -e "export PATH=/opt/erlang/bin:\$PATH\n" > /etc/profile.d/erlang.sh
rm -rf /root/.kerl
yum clean all
mkdir -p /opt/rebar/{bin,escript}
curl -o /opt/rebar/escript/rebar3 https://s3.amazonaws.com/rebar3/rebar3
chmod a+x /opt/rebar/escript/rebar3
/opt/rebar/escript/rebar3 unstable install
ln -s /root/.cache/rebar3/bin/rebar3 /opt/rebar/bin/rebar3
rebar3 update
else
cat /root/.kerl/builds/18.1/otp_build_18.1.log >&2
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment