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 # No cross compilation support for ubuntu1804 because of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983477
16 FROM ubuntu:bionic as build_aarch64
18 ONBUILD ADD generated/go1.17.1.linux-arm64.tar.gz /usr/local/
19 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
20 # Install nodejs and npm
21 ONBUILD ADD generated/node-v10.23.1-linux-arm64.tar.xz /usr/local/
22 ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-arm64/bin/* /usr/local/bin/
24 FROM build_${HOSTTYPE}
26 MAINTAINER Arvados Package Maintainers <packaging@arvados.org>
28 ENV DEBIAN_FRONTEND noninteractive
30 SHELL ["/bin/bash", "-c"]
31 # Install dependencies.
32 RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y python3.8 python3-pip libcurl4-gnutls-dev libgnutls28-dev curl git libattr1-dev libfuse-dev libpq-dev unzip tzdata python3.8-venv python3.8-dev libpam-dev equivs
35 RUN /usr/bin/pip3 install 'virtualenv<20'
38 ADD generated/mpapis.asc /tmp/
39 ADD generated/pkuczynski.asc /tmp/
40 RUN gpg --import --no-tty /tmp/mpapis.asc && \
41 gpg --import --no-tty /tmp/pkuczynski.asc && \
42 curl -L https://get.rvm.io | bash -s stable && \
43 /usr/local/rvm/bin/rvm install 2.7 -j $(grep -c processor /proc/cpuinfo) && \
44 /usr/local/rvm/bin/rvm alias create default ruby-2.7 && \
45 echo "gem: --no-document" >> ~/.gemrc && \
46 /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.2.19 && \
47 /usr/local/rvm/bin/rvm-exec default gem install fpm --version 1.10.2
49 RUN /usr/local/rvm/bin/rvm-exec default bundle config --global jobs $(let a=$(grep -c processor /proc/cpuinfo )-1; echo $a)
50 # Cf. https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/
51 ENV MAKE "make --jobs $(grep -c processor /proc/cpuinfo)"
53 RUN git clone --depth 1 git://git.arvados.org/arvados.git /tmp/arvados && \
54 cd /tmp/arvados/services/api && \
55 /usr/local/rvm/bin/rvm-exec default bundle install && \
56 cd /tmp/arvados/apps/workbench && \
57 /usr/local/rvm/bin/rvm-exec default bundle install && \
61 ENV WORKSPACE /arvados
62 CMD ["/usr/local/rvm/bin/rvm-exec", "default", "bash", "/jenkins/run-build-packages.sh", "--target", "ubuntu1804"]