1 # DESCRIPTION: Erlang 23 container
2 # AUTHOR: https://github.com/r1williams
4 # Build Erlang 23 based on Ubuntu 20.04 LTS
7 # # Download Dockerfile
8 # wget https://raw.githubusercontent.com/ricardson/dockerfiles/master/erlang-23/Dockerfile
11 # docker build -t erlang-23-ubuntu:20.04 .
14 # docker run -it erlang-23-ubuntu:20.04
19 ENV OTP_VERSION="23.3.1" \
20 REBAR3_VERSION="3.14.4"
22 LABEL org.opencontainers.image.version=$OTP_VERSION
26 && DEBIAN_FRONTEND=noninteractive \
27 apt-get -y install --no-install-recommends \
33 libcurl4-openssl-dev \
36 libwxgtk3.0-gtk3-0v5 \
39 libwxgtk3.0-gtk3-dev \
50 && OTP_DOWNLOAD_URL="https://github.com/erlang/otp/archive/OTP-${OTP_VERSION}.tar.gz" \
51 && OTP_DOWNLOAD_SHA256="a5a067a3b17bbef8511f2c056957925b666670b6f2cdaf645e1bc28ce3dd3517" \
52 && curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \
53 && echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \
54 && export ERL_TOP="/usr/src/otp_src_${OTP_VERSION%%@*}" \
55 && mkdir -vp $ERL_TOP \
56 && tar -xzf otp-src.tar.gz -C $ERL_TOP --strip-components=1 \
57 && rm otp-src.tar.gz \
59 && ./otp_build autoconf \
60 && gnuArch="$(dpkg-architecture --query DEB_HOST_GNU_TYPE)" \
61 && ./configure --build="$gnuArch" \
63 && make -j$(nproc) docs DOC_TARGETS=chunks \
64 && make install install-docs DOC_TARGETS=chunks \
65 && find /usr/local -name examples | xargs rm -rf \
66 && apt-get purge -y --auto-remove $buildDeps \
67 && rm -rf $ERL_TOP /var/lib/apt/lists/*
69 ENV REBAR_VERSION="2.6.4"
72 && REBAR_DOWNLOAD_URL="https://github.com/rebar/rebar/archive/${REBAR_VERSION}.tar.gz" \
73 && REBAR_DOWNLOAD_SHA256="577246bafa2eb2b2c3f1d0c157408650446884555bf87901508ce71d5cc0bd07" \
74 && mkdir -p /usr/src/rebar-src \
75 && curl -fSL -o rebar-src.tar.gz "$REBAR_DOWNLOAD_URL" \
76 && echo "$REBAR_DOWNLOAD_SHA256 rebar-src.tar.gz" | sha256sum -c - \
77 && tar -xzf rebar-src.tar.gz -C /usr/src/rebar-src --strip-components=1 \
78 && rm rebar-src.tar.gz \
79 && cd /usr/src/rebar-src \
81 && install -v ./rebar /usr/local/bin/ \
82 && rm -rf /usr/src/rebar-src
85 && REBAR3_DOWNLOAD_URL="https://github.com/erlang/rebar3/archive/${REBAR3_VERSION}.tar.gz" \
86 && REBAR3_DOWNLOAD_SHA256="8d78ed53209682899d777ee9443b26b39c9bf96c8b081fe94b3dd6693077cb9a" \
87 && mkdir -p /usr/src/rebar3-src \
88 && curl -fSL -o rebar3-src.tar.gz "$REBAR3_DOWNLOAD_URL" \
89 && echo "$REBAR3_DOWNLOAD_SHA256 rebar3-src.tar.gz" | sha256sum -c - \
90 && tar -xzf rebar3-src.tar.gz -C /usr/src/rebar3-src --strip-components=1 \
91 && rm rebar3-src.tar.gz \
92 && cd /usr/src/rebar3-src \
93 && HOME=$PWD ./bootstrap \
94 && install -v ./rebar3 /usr/local/bin/ \
95 && rm -rf /usr/src/rebar3-src
100 rm -rf /usr/share/doc/* \
101 && rm -rf /usr/share/info/* \
102 && rm -rf /var/cache/apt/archives/*
104 COPY --from=0 /usr/local/ /usr/local/