blob: 1cdb8cfd687cada2be0f2682bdb1ace8d139cebf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
ARG BASE=ghcr.io/erlang/otp/ubuntu-base
FROM $BASE
ARG MAKEFLAGS=$MAKEFLAGS
ENV MAKEFLAGS=$MAKEFLAGS \
ERL_TOP=/buildroot/otp \
PATH="/Erlang ∅⊤℞/bin":/buildroot/otp/bin:$PATH
ARG ARCHIVE=./otp.tar.gz
COPY $ARCHIVE /buildroot/otp.tar.gz
RUN cd /buildroot && tar -xzf ./otp.tar.gz
WORKDIR /buildroot/otp/
ENV CFLAGS="-O2 -g -Werror"
## Configure (if not cached), check that no application are disabled and then make
RUN if [ ! -f Makefile ]; then \
touch README.md && \
./configure --prefix="/Erlang ∅⊤℞" && \
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
find . -type f -newer README.md | xargs tar --transform 's:^./:otp/:' -cf ../otp_cache.tar; \
fi && \
make && make docs DOC_TARGETS=chunks && \
sudo make install install-docs DOC_TARGETS=chunks
## Disable -Werror as testcases do not compile with it on
ENV CFLAGS="-O2 -g"
## Update init.sh with correct env vars
RUN echo "export MAKEFLAGS=$MAKEFLAGS" > /buildroot/env.sh && \
echo "export ERLC_USE_SERVER=$ERLC_USE_SERVER" >> /buildroot/env.sh && \
echo "export ERL_TOP=\"$ERL_TOP\"" >> /buildroot/env.sh && \
echo "export PATH=\"$PATH\"" >> /buildroot/env.sh && \
echo "export ERL_LIBS=\"$ERL_LIBS\"" >> /buildroot/env.sh
|