1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
9 ## dont use debian:10 here since the word 'buster' is used for rvm precompiled binaries
10 FROM debian:buster as build_x86_64
13 ONBUILD ADD generated/go${GOVERSION}.linux-amd64.tar.gz /usr/local/
14 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
15 # Install nodejs and npm
16 ONBUILD ADD generated/node-v10.23.1-linux-x64.tar.xz /usr/local/
17 ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-x64/bin/* /usr/local/bin/
18 # No cross compilation support for debian10 because of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983477
20 FROM debian:buster as build_aarch64
23 ONBUILD ADD generated/go${GOVERSION}.linux-arm64.tar.gz /usr/local/
24 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
25 # Install nodejs and npm
26 ONBUILD ADD generated/node-v10.23.1-linux-arm64.tar.xz /usr/local/
27 ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-arm64/bin/* /usr/local/bin/
29 FROM build_${HOSTTYPE}
31 MAINTAINER Arvados Package Maintainers <packaging@arvados.org>
33 ENV DEBIAN_FRONTEND noninteractive
35 SHELL ["/bin/bash", "-c"]
36 # Install dependencies.
37 RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y python3 python3-setuptools python3-pip libcurl4-gnutls-dev curl git procps libattr1-dev libfuse-dev libgnutls28-dev libpq-dev unzip python3-venv python3-dev libpam-dev equivs
40 RUN /usr/bin/pip3 install 'virtualenv<20'
43 ADD generated/mpapis.asc /tmp/
44 ADD generated/pkuczynski.asc /tmp/
45 RUN gpg --import --no-tty /tmp/mpapis.asc && \
46 gpg --import --no-tty /tmp/pkuczynski.asc && \
47 curl -L https://get.rvm.io | bash -s stable && \
48 /usr/local/rvm/bin/rvm install 2.7 -j $(grep -c processor /proc/cpuinfo) && \
49 /usr/local/rvm/bin/rvm alias create default ruby-2.7 && \
50 echo "gem: --no-document" >> ~/.gemrc && \
51 /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.2.19 && \
52 /usr/local/rvm/bin/rvm-exec default gem install fpm --version 1.15.1
54 RUN /usr/local/rvm/bin/rvm-exec default bundle config --global jobs $(let a=$(grep -c processor /proc/cpuinfo )-1; echo $a)
55 # Cf. https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/
56 ENV MAKE "make --jobs $(grep -c processor /proc/cpuinfo)"
58 # Preseed the go module cache and the ruby gems, using the currently checked
59 # out branch of the source tree. This avoids potential compatibility issues
60 # between the version of Ruby and certain gems.
61 RUN git clone --depth 1 git://git.arvados.org/arvados.git /tmp/arvados && \
63 if [[ -n "${BRANCH}" ]]; then git checkout ${BRANCH}; fi && \
64 cd /tmp/arvados/services/api && \
65 /usr/local/rvm/bin/rvm-exec default bundle install && \
66 cd /tmp/arvados/apps/workbench && \
67 /usr/local/rvm/bin/rvm-exec default bundle install && \
71 ENV WORKSPACE /arvados
72 CMD ["/usr/local/rvm/bin/rvm-exec", "default", "bash", "/jenkins/run-build-packages.sh", "--target", "debian10"]