From a434fa4622023560e2877a1de698fd4fd15e6b31 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 6 Mar 2017 16:00:21 +0100 Subject: Add docker images for building 32/64 bit erlang --- scripts/Dockerfile.32 | 13 +++++++++++++ scripts/Dockerfile.32.ubuntu | 5 +++++ scripts/Dockerfile.64 | 13 +++++++++++++ scripts/Dockerfile.64.ubuntu | 5 +++++ scripts/build-docker-otp | 13 +++++++++++++ scripts/build-otp | 6 +++++- 6 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 scripts/Dockerfile.32 create mode 100644 scripts/Dockerfile.32.ubuntu create mode 100644 scripts/Dockerfile.64 create mode 100644 scripts/Dockerfile.64.ubuntu create mode 100755 scripts/build-docker-otp diff --git a/scripts/Dockerfile.32 b/scripts/Dockerfile.32 new file mode 100644 index 0000000000..9622c48a17 --- /dev/null +++ b/scripts/Dockerfile.32 @@ -0,0 +1,13 @@ +FROM erlang/ubuntu-build:32bit + +COPY ./otp.tar.gz /buildroot/ + +WORKDIR /buildroot/ + +RUN tar xzf otp.tar.gz + +WORKDIR /buildroot/otp/ + +ENV MAKEFLAGS -j10 + +CMD ./scripts/build-otp diff --git a/scripts/Dockerfile.32.ubuntu b/scripts/Dockerfile.32.ubuntu new file mode 100644 index 0000000000..c334f74379 --- /dev/null +++ b/scripts/Dockerfile.32.ubuntu @@ -0,0 +1,5 @@ +FROM 32bit/ubuntu:16.04 + +RUN apt-get update + +RUN apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev fop xsltproc default-jdk git autoconf libwxbase3.0-dev libwxgtk3.0-dev diff --git a/scripts/Dockerfile.64 b/scripts/Dockerfile.64 new file mode 100644 index 0000000000..47702b04a5 --- /dev/null +++ b/scripts/Dockerfile.64 @@ -0,0 +1,13 @@ +FROM erlang/ubuntu-build:64bit + +COPY ./otp.tar.gz /buildroot/ + +WORKDIR /buildroot/ + +RUN tar xzf otp.tar.gz + +WORKDIR /buildroot/otp/ + +ENV MAKEFLAGS -j10 + +CMD ./scripts/build-otp diff --git a/scripts/Dockerfile.64.ubuntu b/scripts/Dockerfile.64.ubuntu new file mode 100644 index 0000000000..514fea70b5 --- /dev/null +++ b/scripts/Dockerfile.64.ubuntu @@ -0,0 +1,5 @@ +FROM ubuntu:16.04 + +RUN apt-get update + +RUN apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev fop xsltproc default-jdk git autoconf libwxbase3.0-dev libwxgtk3.0-dev diff --git a/scripts/build-docker-otp b/scripts/build-docker-otp new file mode 100755 index 0000000000..d796759691 --- /dev/null +++ b/scripts/build-docker-otp @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ $# -lt 1 ]; then + echo "Usage $0 32|64 [command]" + exit 1 +fi + +ARCH="$1" + +git archive --format=tar.gz --prefix=otp/ HEAD >otp.tar.gz + +docker build -t otp --file scripts/Dockerfile.$ARCH . +docker run --volume="$PWD/logs:/buildroot/otp/logs" -i --rm otp $2 diff --git a/scripts/build-otp b/scripts/build-otp index da09fb8045..92031c79c8 100755 --- a/scripts/build-otp +++ b/scripts/build-otp @@ -14,7 +14,7 @@ function progress { } function do_and_log { - log="scripts/latest-log.$$" + log="logs/latest-log.$$" echo "" >$log echo -n "$1..." (progress $log) & @@ -32,6 +32,10 @@ function do_and_log { fi } +if [ ! -d "logs" ]; then + mkdir logs +fi + do_and_log "Autoconfing" autoconf do_and_log "Configuring" configure do_and_log "Building OTP" boot -a -- cgit v1.2.3