summaryrefslogtreecommitdiff
path: root/.github/dockerfiles/Dockerfile.64-bit
blob: 25aadc5e84e0dab215b9ce8719c74ed123fa3ea8 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
ARG BASE=docker.pkg.github.com/erlang/otp/ubuntu-base
FROM $BASE

ARG MAKEFLAGS=$MAKEFLAGS
ENV MAKEFLAGS=$MAKEFLAGS \
    ERL_TOP=/buildroot/otp \
    PATH=/otp/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, check that no application are disabled and then make
RUN  ./configure --prefix=/otp && \
        if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
        make && sudo make install

## Disable -Werror as testcases do not compile with it on
ENV CFLAGS="-O2 -g"

WORKDIR /buildroot/

## Install test tools rebar3, proper and jsx
RUN latest () { \
    local VSN=$(curl -sL "https://api.github.com/repos/$1/tags" | jq -r ".[] | .name" | grep -E '^v?[0-9]' | sort -V | tail -1); \
    curl -sL "https://github.com/$1/archive/$VSN.tar.gz" > $(basename $1).tar.gz; \
    } && \
    latest erlang/rebar3 && ls -la && \
    (tar xzf rebar3.tar.gz && cd rebar3-* && ./bootstrap && sudo cp rebar3 /usr/bin) && \
    latest proper-testing/proper && \
    (tar xzf proper.tar.gz && mv proper-* proper && cd proper && make) && \
    latest talentdeficit/jsx && \
    (tar xzf jsx.tar.gz && mv jsx-* jsx && cd jsx && rebar3 compile)

ENV ERL_LIBS=/buildroot/proper:/buildroot/jsx

WORKDIR /buildroot/otp/

## 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