1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 FROM ubuntu:bionic as build_x86_64
9 ONBUILD ADD generated/go1.17.1.linux-amd64.tar.gz /usr/local/
10 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
11 # Install nodejs and npm
12 ONBUILD ADD generated/node-v10.23.1-linux-x64.tar.xz /usr/local/
13 ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-x64/bin/* /usr/local/bin/
14 # On x86, we want some cross-compilation support for arm64
15 # Add gcc-aarch64-linux-gnu to compile go binaries for arm64
16 ONBUILD RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y gcc-aarch64-linux-gnu
17 # We also need libpam compiled for arm64, and that requires some sources.list mangling
18 ONBUILD RUN /bin/sed -i 's/deb http/deb [ arch=amd64 ] http/' /etc/apt/sources.list
19 ONBUILD ADD ports.list /etc/apt/sources.list.d/
20 ONBUILD RUN /usr/bin/dpkg --add-architecture arm64
21 ONBUILD RUN /usr/bin/apt-get update && /usr/bin/apt-get install -o APT::Immediate-Configure=0 -q -y libpam0g-dev:arm64
23 FROM ubuntu:bionic as build_aarch64
25 ONBUILD ADD generated/go1.17.1.linux-arm64.tar.gz /usr/local/
26 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
27 # Install nodejs and npm
28 ONBUILD ADD generated/node-v10.23.1-linux-arm64.tar.xz /usr/local/
29 ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-arm64/bin/* /usr/local/bin/
31 FROM build_${HOSTTYPE}
33 MAINTAINER Arvados Package Maintainers <packaging@arvados.org>
35 ENV DEBIAN_FRONTEND noninteractive
37 SHELL ["/bin/bash", "-c"]
38 # Install dependencies.
39 RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y python3 python3-pip libcurl4-gnutls-dev libgnutls28-dev curl git libattr1-dev libfuse-dev libpq-dev unzip tzdata python3-venv python3-dev libpam-dev equivs
42 RUN /usr/bin/pip3 install 'virtualenv<20'
45 ADD generated/mpapis.asc /tmp/
46 ADD generated/pkuczynski.asc /tmp/
47 RUN gpg --import --no-tty /tmp/mpapis.asc && \
48 gpg --import --no-tty /tmp/pkuczynski.asc && \
49 curl -L https://get.rvm.io | bash -s stable && \
50 /usr/local/rvm/bin/rvm install 2.5 -j $(grep -c processor /proc/cpuinfo) && \
51 /usr/local/rvm/bin/rvm alias create default ruby-2.5 && \
52 echo "gem: --no-document" >> ~/.gemrc && \
53 /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.2.19 && \
54 /usr/local/rvm/bin/rvm-exec default gem install fpm --version 1.10.2
56 RUN /usr/local/rvm/bin/rvm-exec default bundle config --global jobs $(let a=$(grep -c processor /proc/cpuinfo )-1; echo $a)
57 # Cf. https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/
58 ENV MAKE "make --jobs $(grep -c processor /proc/cpuinfo)"
60 RUN git clone --depth 1 git://git.arvados.org/arvados.git /tmp/arvados && \
61 cd /tmp/arvados/services/api && \
62 /usr/local/rvm/bin/rvm-exec default bundle install && \
63 cd /tmp/arvados/apps/workbench && \
64 /usr/local/rvm/bin/rvm-exec default bundle install && \
68 ENV WORKSPACE /arvados
69 CMD ["/usr/local/rvm/bin/rvm-exec", "default", "bash", "/jenkins/run-build-packages.sh", "--target", "ubuntu1804"]