summaryrefslogtreecommitdiff
path: root/.github/dockerfiles/Dockerfile.debian-base
blob: 1c266779595bdd910cad94afa8c5f51c4baa09e6 (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
##
## This docker file will build a base image for building Erlang/OTP
##
ARG BASE=debian
FROM $BASE
## Need to have a second arg here as the first does not expose the $BASE in the script below
ARG BASE=debian

ARG HOST_ARCH=amd64
ARG HOST_TRIP=x86_64-linux-gnu

ENV INSTALL_LIBS="zlib1g-dev libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxbase3.0-dev libwxgtk3.0-dev libsctp-dev lksctp-tools"

## See https://wiki.debian.org/Multiarch/HOWTO for details on how to install things
RUN if [ "$BASE" = "i386/debian" ]; then BUILD_ARCH=`dpkg --print-architecture` && \
        dpkg --add-architecture $HOST_ARCH && \
        sed -i "s:deb http:deb [arch=$BUILD_ARCH,$HOST_ARCH] http:g" /etc/apt/sources.list; \
    fi

RUN apt-get update && \
        apt-get -y upgrade && \
        apt-get install -y build-essential m4 autoconf fop xsltproc \
        default-jdk libxml2-utils $INSTALL_LIBS

RUN if [ "$BASE" = "i386/debian" ]; then apt-get install -y \
        crossbuild-essential-$HOST_ARCH \
        $(for LIB in $INSTALL_LIBS; do echo "$LIB:$HOST_ARCH"; done) && \
        for dir in `find / -type d -name $HOST_TRIP`; do \
          echo -n "$dir: /buildroot/sysroot"; \
          echo `dirname $dir`; \
          mkdir -p /buildroot/sysroot$dir; \
          cp -r `dirname $dir`/* `dirname /buildroot/sysroot$dir`; \
          cp -r $dir/* `dirname /buildroot/sysroot$dir`; \
        done; fi