1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
9 ## dont use debian:11 here since the word 'bullseye' is used for rvm precompiled binaries
10 FROM debian:bullseye 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 # On x86, we want some cross-compilation support for arm64
19 # Add gcc-aarch64-linux-gnu to compile go binaries for arm64
20 ONBUILD RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y gcc-aarch64-linux-gnu
21 # We also need libpam compiled for arm64
22 ONBUILD RUN /usr/bin/dpkg --add-architecture arm64
23 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
25 FROM debian:bullseye as build_aarch64
28 ONBUILD ADD generated/go${GOVERSION}.linux-arm64.tar.gz /usr/local/
29 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
30 # Install nodejs and npm
31 ONBUILD ADD generated/node-v10.23.1-linux-arm64.tar.xz /usr/local/
32 ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-arm64/bin/* /usr/local/bin/
34 FROM build_${HOSTTYPE}
35 RUN echo HOSTTYPE ${HOSTTYPE}
37 MAINTAINER Arvados Package Maintainers <packaging@arvados.org>
39 ENV DEBIAN_FRONTEND noninteractive
41 SHELL ["/bin/bash", "-c"]
42 # Install dependencies.
43 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
46 RUN /usr/bin/pip3 install 'virtualenv<20'
49 ADD generated/mpapis.asc /tmp/
50 ADD generated/pkuczynski.asc /tmp/
51 RUN gpg --import --no-tty /tmp/mpapis.asc && \
52 gpg --import --no-tty /tmp/pkuczynski.asc && \
53 curl -L https://get.rvm.io | bash -s stable && \
54 /usr/local/rvm/bin/rvm install 2.7 -j $(grep -c processor /proc/cpuinfo) --disable-binary && \
55 /usr/local/rvm/bin/rvm alias create default ruby-2.7 && \
56 echo "gem: --no-document" >> ~/.gemrc && \
57 /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.2.19 && \
58 /usr/local/rvm/bin/rvm-exec default gem install fpm --version 1.10.2
60 RUN /usr/local/rvm/bin/rvm-exec default bundle config --global jobs $(let a=$(grep -c processor /proc/cpuinfo )-1; echo $a)
61 # Cf. https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/
62 ENV MAKE "make --jobs $(grep -c processor /proc/cpuinfo)"
64 # Preseed the go module cache and the ruby gems, using the currently checked
65 # out branch of the source tree. This avoids potential compatibility issues
66 # between the version of Ruby and certain gems.
67 RUN git clone --depth 1 git://git.arvados.org/arvados.git /tmp/arvados && \
69 if [[ -n "${BRANCH}" ]]; then git checkout ${BRANCH}; fi && \
70 cd /tmp/arvados/services/api && \
71 /usr/local/rvm/bin/rvm-exec default bundle install && \
72 cd /tmp/arvados/apps/workbench && \
73 /usr/local/rvm/bin/rvm-exec default bundle install && \
77 ENV WORKSPACE /arvados
78 CMD ["/usr/local/rvm/bin/rvm-exec", "default", "bash", "/jenkins/run-build-packages.sh", "--target", "debian11"]