Skip to content

Commit

Permalink
Refactored project layout & Dockerfiles for standard & slim versions …
Browse files Browse the repository at this point in the history
…of Erlang 18 & 17
  • Loading branch information
vovimayhem committed Nov 7, 2015
1 parent 509b8c6 commit c224941
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 31 deletions.
20 changes: 12 additions & 8 deletions 17/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
FROM buildpack-deps:jessie

ENV OTP_VERSION 17.5.6.4

ENV OTP_DOWNLOAD_SHA1 8436bbc750dc90580842e907f911255228d2d070
ENV LANG C.UTF-8

RUN set -xe \
&& OTP_DOWNLOAD_URL=https://github.com/erlang/otp/archive/OTP-$OTP_VERSION.tar.gz \
&& OTP_DOWNLOAD_SHA1=8436bbc750dc90580842e907f911255228d2d070 \
&& curl -SL $OTP_DOWNLOAD_URL -o otp-src.tar.gz \
&& echo "$OTP_DOWNLOAD_SHA1 otp-src.tar.gz" | sha1sum -c - \
# We'll install the build dependencies for erlang-odbc along with the erlang
# build process:
RUN buildDeps='unixodbc-dev' \
&& set -xe \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& mkdir -p /usr/src/otp-src \
&& tar -xzC /usr/src/otp-src --strip-components=1 -f otp-src.tar.gz \
&& curl -fSL -o otp-src.tar.gz "https://github.com/erlang/otp/archive/OTP-$OTP_VERSION.tar.gz" \
&& echo "$OTP_DOWNLOAD_SHA1 otp-src.tar.gz" | sha1sum -c - \
&& tar -xzf otp-src.tar.gz -C /usr/src/otp-src --strip-components=1 \
&& rm otp-src.tar.gz \
&& cd /usr/src/otp-src \
&& ./otp_build autoconf \
&& ./configure \
&& make -j$(nproc) \
&& make install \
&& find /usr/local -name examples |xargs rm -rf \
&& rm -rf /usr/src/otp-src
&& rm -rf /usr/src/otp-src \
&& apt-get purge -y --auto-remove $buildDeps

CMD ["erl"]
45 changes: 45 additions & 0 deletions 17/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM debian:jessie

ENV OTP_VERSION 17.5.6.4
ENV OTP_DOWNLOAD_SHA1 8436bbc750dc90580842e907f911255228d2d070
ENV LANG C.UTF-8

# We'll install the build dependencies, and purge them on the last step to make
# sure our final image contains only what we've just built:
RUN buildDeps=' \
autoconf \
bison \
ca-certificates \
curl \
gcc \
g++ \
libbz2-dev \
libgdbm-dev \
libglib2.0-dev \
libncurses-dev \
libreadline-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
unixodbc-dev \
make \
' \
&& set -xe \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/src/otp-src \
&& curl -fSL -o otp-src.tar.gz "https://github.com/erlang/otp/archive/OTP-$OTP_VERSION.tar.gz" \
&& echo "$OTP_DOWNLOAD_SHA1 otp-src.tar.gz" | sha1sum -c - \
&& tar -xzf otp-src.tar.gz -C /usr/src/otp-src --strip-components=1 \
&& rm otp-src.tar.gz \
&& cd /usr/src/otp-src \
&& ./otp_build autoconf \
&& ./configure \
&& make -j$(nproc) \
&& make install \
&& find /usr/local -name examples |xargs rm -rf \
&& rm -rf /usr/src/otp-src \
&& apt-get purge -y --auto-remove $buildDeps

CMD ["erl"]
20 changes: 12 additions & 8 deletions 18/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
FROM buildpack-deps:jessie

ENV OTP_VERSION 18.1.3

ENV OTP_DOWNLOAD_SHA1 981e6c03c0a310483e6c14edb7dd2acaa842e2f8
ENV LANG C.UTF-8

RUN set -xe \
&& OTP_DOWNLOAD_URL=https://github.com/erlang/otp/archive/OTP-$OTP_VERSION.tar.gz \
&& OTP_DOWNLOAD_SHA1=981e6c03c0a310483e6c14edb7dd2acaa842e2f8 \
&& curl -SL $OTP_DOWNLOAD_URL -o otp-src.tar.gz \
&& echo "$OTP_DOWNLOAD_SHA1 otp-src.tar.gz" | sha1sum -c - \
# We'll install the build dependencies for erlang-odbc along with the erlang
# build process:
RUN buildDeps='unixodbc-dev' \
&& set -xe \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& mkdir -p /usr/src/otp-src \
&& tar -xzC /usr/src/otp-src --strip-components=1 -f otp-src.tar.gz \
&& curl -fSL -o otp-src.tar.gz "https://github.com/erlang/otp/archive/OTP-$OTP_VERSION.tar.gz" \
&& echo "$OTP_DOWNLOAD_SHA1 otp-src.tar.gz" | sha1sum -c - \
&& tar -xzf otp-src.tar.gz -C /usr/src/otp-src --strip-components=1 \
&& rm otp-src.tar.gz \
&& cd /usr/src/otp-src \
&& ./otp_build autoconf \
&& ./configure \
&& make -j$(nproc) \
&& make install \
&& find /usr/local -name examples |xargs rm -rf \
&& rm -rf /usr/src/otp-src
&& rm -rf /usr/src/otp-src \
&& apt-get purge -y --auto-remove $buildDeps

CMD ["erl"]
15 changes: 0 additions & 15 deletions 18/esl/Dockerfile

This file was deleted.

46 changes: 46 additions & 0 deletions 18/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM debian:jessie

ENV OTP_VERSION 18.1.3
ENV OTP_DOWNLOAD_SHA1 981e6c03c0a310483e6c14edb7dd2acaa842e2f8
ENV LANG C.UTF-8

# We'll install the build dependencies, and purge them on the last step to make
# sure our final image contains only what we've just built:
RUN buildDeps=' \
autoconf \
bison \
ca-certificates \
curl \
gcc \
g++ \
libbz2-dev \
libgdbm-dev \
libglib2.0-dev \
libncurses-dev \
libodbc1 \
libreadline-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
unixodbc-dev \
make \
' \
&& set -xe \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/src/otp-src \
&& curl -fSL -o otp-src.tar.gz "https://github.com/erlang/otp/archive/OTP-$OTP_VERSION.tar.gz" \
&& echo "$OTP_DOWNLOAD_SHA1 otp-src.tar.gz" | sha1sum -c - \
&& tar -xzf otp-src.tar.gz -C /usr/src/otp-src --strip-components=1 \
&& rm otp-src.tar.gz \
&& cd /usr/src/otp-src \
&& ./otp_build autoconf \
&& ./configure \
&& make -j$(nproc) \
&& make install \
&& find /usr/local -name examples |xargs rm -rf \
&& rm -rf /usr/src/otp-src \
&& apt-get purge -y --auto-remove $buildDeps

CMD ["erl"]

0 comments on commit c224941

Please sign in to comment.