1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 ## dont use debian:11 here since the word 'bullseye' is used for rvm precompiled binaries
8 FROM debian:bullseye as build_x86_64
10 ONBUILD ADD generated/go1.17.1.linux-amd64.tar.gz /usr/local/
11 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
12 # Install nodejs and npm
13 ONBUILD ADD generated/node-v10.23.1-linux-x64.tar.xz /usr/local/
14 ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-x64/bin/* /usr/local/bin/
15 # On x86, we want some cross-compilation support for arm64
16 # Add gcc-aarch64-linux-gnu to compile go binaries for arm64
17 ONBUILD RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y gcc-aarch64-linux-gnu
18 # We also need libpam compiled for arm64
19 ONBUILD RUN /usr/bin/dpkg --add-architecture arm64
20 ONBUILD RUN /usr/bin/apt-get update && /usr/bin/apt-get install -o APT::Immediate-Configure=0 -q -y libpam0g-dev:arm64
22 FROM debian:bullseye as build_aarch64
24 ONBUILD ADD generated/go1.17.1.linux-arm64.tar.gz /usr/local/
25 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
26 # Install nodejs and npm
27 ONBUILD ADD generated/node-v10.23.1-linux-arm64.tar.xz /usr/local/
28 ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-arm64/bin/* /usr/local/bin/
30 FROM build_${HOSTTYPE}
32 MAINTAINER Arvados Package Maintainers <packaging@arvados.org>
34 ENV DEBIAN_FRONTEND noninteractive
36 SHELL ["/bin/bash", "-c"]
37 # Install dependencies.
38 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
41 RUN /usr/bin/pip3 install 'virtualenv<20'
44 ADD generated/mpapis.asc /tmp/
45 ADD generated/pkuczynski.asc /tmp/
46 RUN gpg --import --no-tty /tmp/mpapis.asc && \
47 gpg --import --no-tty /tmp/pkuczynski.asc && \
48 curl -L https://get.rvm.io | bash -s stable && \
49 /usr/local/rvm/bin/rvm install 2.5 -j $(grep -c processor /proc/cpuinfo) && \
50 /usr/local/rvm/bin/rvm alias create default ruby-2.5 && \
51 echo "gem: --no-document" >> ~/.gemrc && \
52 /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.2.19 && \
53 /usr/local/rvm/bin/rvm-exec default gem install fpm --version 1.10.2
55 RUN /usr/local/rvm/bin/rvm-exec default bundle config --global jobs $(let a=$(grep -c processor /proc/cpuinfo )-1; echo $a)
56 # Cf. https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/
57 ENV MAKE "make --jobs $(grep -c processor /proc/cpuinfo)"
59 RUN git clone --depth 1 git://git.arvados.org/arvados.git /tmp/arvados && \
60 cd /tmp/arvados/services/api && \
61 /usr/local/rvm/bin/rvm-exec default bundle install && \
62 cd /tmp/arvados/apps/workbench && \
63 /usr/local/rvm/bin/rvm-exec default bundle install
65 ENV WORKSPACE /arvados
66 CMD ["/usr/local/rvm/bin/rvm-exec", "default", "bash", "/jenkins/run-build-packages.sh", "--target", "debian11"]