1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
9 ## dont use debian:12 here since the word 'bookworm' is used for rvm precompiled binaries
10 FROM debian:bookworm as build_x86_64
14 ONBUILD ADD generated/go${GOVERSION}.linux-amd64.tar.gz /usr/local/
15 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
16 # Install nodejs and npm
17 ONBUILD ADD generated/node-v12.22.12-linux-x64.tar.xz /usr/local/
18 ONBUILD RUN env -C /usr/local/node-v12.22.12-linux-x64/bin PATH="$PATH:." ./npm install -g yarn
19 ONBUILD RUN ln -sf /usr/local/node-v12.22.12-linux-x64/bin/* /usr/local/bin/
20 # On x86, we want some cross-compilation support for arm64
21 # Add gcc-aarch64-linux-gnu to compile go binaries for arm64
22 ONBUILD RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y gcc-aarch64-linux-gnu
23 # We also need libpam compiled for arm64
24 ONBUILD RUN /usr/bin/dpkg --add-architecture arm64
25 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
27 FROM debian:bookworm as build_aarch64
31 ONBUILD ADD generated/go${GOVERSION}.linux-arm64.tar.gz /usr/local/
32 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
33 # Install nodejs and npm
34 ONBUILD ADD generated/node-v12.22.12-linux-arm64.tar.xz /usr/local/
35 ONBUILD RUN env -C /usr/local/node-v12.22.12-linux-arm64/bin PATH="$PATH:." ./npm install -g yarn
36 ONBUILD RUN ln -sf /usr/local/node-v12.22.12-linux-arm64/bin/* /usr/local/bin/
38 FROM build_${HOSTTYPE}
39 RUN echo HOSTTYPE ${HOSTTYPE}
41 MAINTAINER Arvados Package Maintainers <packaging@arvados.org>
43 ENV DEBIAN_FRONTEND noninteractive
45 SHELL ["/bin/bash", "-c"]
46 # Install dependencies.
47 RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y python3 libcurl4-gnutls-dev curl git procps libattr1-dev libfuse-dev libgnutls28-dev libpq-dev unzip python3-venv python3-dev libpam-dev equivs
50 ADD generated/mpapis.asc /tmp/
51 ADD generated/pkuczynski.asc /tmp/
52 RUN gpg --import --no-tty /tmp/mpapis.asc && \
53 gpg --import --no-tty /tmp/pkuczynski.asc && \
54 curl -L https://get.rvm.io | bash -s stable && \
55 /usr/local/rvm/bin/rvm install 3.2.2 -j $(grep -c processor /proc/cpuinfo) --disable-binary && \
56 /usr/local/rvm/bin/rvm alias create default ruby-3.2.2 && \
57 echo "gem: --no-document" >> ~/.gemrc && \
58 /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.2.19 && \
59 /usr/local/rvm/bin/rvm-exec default gem install fpm --version 1.15.1
61 RUN /usr/local/rvm/bin/rvm-exec default bundle config --global jobs $(let a=$(grep -c processor /proc/cpuinfo )-1; echo $a)
62 # Cf. https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/
63 ENV MAKE "make --jobs 8"
65 # Preseed the go module cache and the ruby gems, using the currently checked
66 # out branch of the source tree. This avoids potential compatibility issues
67 # between the version of Ruby and certain gems.
68 RUN git clone git://git.arvados.org/arvados.git /tmp/arvados && \
70 if [[ -n "${BRANCH}" ]]; then git checkout ${BRANCH}; fi && \
71 cd /tmp/arvados/services/api && \
72 /usr/local/rvm/bin/rvm-exec default bundle install && \
76 ENV WORKSPACE /arvados
77 CMD ["/usr/local/rvm/bin/rvm-exec", "default", "bash", "/jenkins/run-build-packages.sh", "--target", "debian12"]