1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
8 ## dont use debian:11 here since the word 'bullseye' is used for rvm precompiled binaries
9 FROM debian:bullseye as build_x86_64
11 ONBUILD ADD generated/go1.17.1.linux-amd64.tar.gz /usr/local/
12 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
13 # Install nodejs and npm
14 ONBUILD ADD generated/node-v10.23.1-linux-x64.tar.xz /usr/local/
15 ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-x64/bin/* /usr/local/bin/
16 # On x86, we want some cross-compilation support for arm64
17 # Add gcc-aarch64-linux-gnu to compile go binaries for arm64
18 ONBUILD RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y gcc-aarch64-linux-gnu
19 # We also need libpam compiled for arm64
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 libfuse-dev:arm64
23 FROM debian:bullseye 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-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
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.7 -j $(grep -c processor /proc/cpuinfo) && \
51 /usr/local/rvm/bin/rvm alias create default ruby-2.7 && \
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 # Preseed the go module cache and the ruby gems, using the currently checked
61 # out branch of the source tree. This avoids potential compatibility issues
62 # between the version of Ruby and certain gems.
63 RUN git clone --depth 1 git://git.arvados.org/arvados.git /tmp/arvados && \
65 if [[ -n "${BRANCH}" ]]; then git checkout ${BRANCH}; fi && \
66 cd /tmp/arvados/services/api && \
67 /usr/local/rvm/bin/rvm-exec default bundle install && \
68 cd /tmp/arvados/apps/workbench && \
69 /usr/local/rvm/bin/rvm-exec default bundle install && \
73 ENV WORKSPACE /arvados
74 CMD ["/usr/local/rvm/bin/rvm-exec", "default", "bash", "/jenkins/run-build-packages.sh", "--target", "debian11"]