Created
November 23, 2015 17:28
-
-
Save waisbrot/3415d53f7c0b66a36013 to your computer and use it in GitHub Desktop.
Erlang in Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM <<<private amazon-linux base-image>>> | |
ENV PATH=/opt/erlang/bin:/opt/rebar/bin:$PATH | |
COPY install.bash /tmp/ | |
RUN ["/tmp/install.bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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