1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
9 FROM ubuntu:noble 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-v12.22.12-linux-x64.tar.xz /usr/local/
17 ONBUILD RUN env -C /usr/local/node-v12.22.12-linux-x64/bin ./node npm install -g yarn
18 ONBUILD RUN ln -sf /usr/local/node-v12.22.12-linux-x64/bin/* /usr/local/bin/
19 # On x86, we want some cross-compilation support for arm64
20 # Add gcc-aarch64-linux-gnu to compile go binaries for arm64
21 ONBUILD COPY ports.list /etc/apt/sources.list.d/
22 # We also need libpam compiled for arm64, and that requires some sources.list mangling
23 ONBUILD RUN sed -i '/^Signed-By: / i Architectures: amd64' /etc/apt/sources.list.d/ubuntu.sources \
24 && dpkg --add-architecture arm64 \
26 && apt-get install -o APT::Immediate-Configure=0 -q -y gcc-aarch64-linux-gnu libpam0g-dev:arm64 libfuse-dev:arm64
28 FROM ubuntu:noble as build_aarch64
32 ONBUILD ADD generated/go${GOVERSION}.linux-arm64.tar.gz /usr/local/
33 ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/
34 # Install nodejs and npm
35 ONBUILD ADD generated/node-v12.22.12-linux-arm64.tar.xz /usr/local/
36 ONBUILD RUN env -C /usr/local/node-v12.22.12-linux-arm64/bin ./node npm install -g yarn
37 ONBUILD RUN ln -sf /usr/local/node-v12.22.12-linux-arm64/bin/* /usr/local/bin/
39 FROM build_${HOSTTYPE}
41 LABEL org.opencontainers.image.authors="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 \
68 RUN echo "gem: --no-document" >> ~/.gemrc && \
69 gem install --conservative --version '>= 2.4.0' bundler && \
70 gem install fpm --version 1.15.1 && \
71 ln -s /usr/bin/bundler3.2 /usr/local/bin/bundle && \
72 bundle config --global jobs $(let a=$(grep -c processor /proc/cpuinfo )-1; echo $a)
74 # Cf. https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/
75 ENV MAKE "make --jobs 8"
77 # Preseed the go module cache.
78 RUN git clone git://git.arvados.org/arvados.git /tmp/arvados && \
80 if [[ -n "${BRANCH}" ]]; then git checkout ${BRANCH}; fi && \
83 ENV WORKSPACE /arvados
84 CMD ["bash", "/jenkins/run-build-packages.sh", "--target", "ubuntu2404"]