21158: Set maxHeight to match new process panel layout
[arvados.git] / build / package-build-dockerfiles / centos7 / Dockerfile
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 ARG HOSTTYPE
6 ARG BRANCH
7 ARG GOVERSION
8
9 FROM centos:7 as build_x86_64
10 ONBUILD ARG BRANCH
11 # Install go
12 ONBUILD ARG GOVERSION
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 ln -s /usr/local/node-v12.22.12-linux-x64/bin/* /usr/local/bin/
18 ONBUILD RUN npm install -g yarn
19 ONBUILD RUN ln -sf /usr/local/node-v12.22.12-linux-x64/bin/* /usr/local/bin/
20
21 FROM centos:7 as build_aarch64
22 ONBUILD ARG BRANCH
23 # Install go
24 ONBUILD ARG GOVERSION
25 ONBUILD ADD generated/go${GOVERSION}.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-v12.22.12-linux-arm64.tar.xz /usr/local/
29 ONBUILD RUN ln -s /usr/local/node-v12.22.12-linux-arm64/bin/* /usr/local/bin/
30 ONBUILD RUN npm install -g yarn
31 ONBUILD RUN ln -sf /usr/local/node-v12.22.12-linux-arm64/bin/* /usr/local/bin/
32
33 FROM build_${HOSTTYPE}
34
35 MAINTAINER Arvados Package Maintainers <packaging@arvados.org>
36
37 ENV DEBIAN_FRONTEND noninteractive
38
39 SHELL ["/bin/bash", "-c"]
40 # Install dependencies.
41 RUN yum -q -y install make automake gcc gcc-c++ libyaml-devel patch readline-devel zlib-devel libffi-devel openssl-devel bzip2 libtool bison sqlite-devel rpm-build git libattr-devel nss-devel libcurl-devel which tar unzip scl-utils centos-release-scl postgresql-devel fuse-devel xz-libs git wget pam-devel
42
43 # Install RVM
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.7 -j $(grep -c processor /proc/cpuinfo) && \
50     /usr/local/rvm/bin/rvm alias create default ruby-2.7 && \
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.15.1
54
55 # Install Bash 4.4.12 // see https://dev.arvados.org/issues/15612
56 RUN cd /usr/local/src \
57 && wget http://ftp.gnu.org/gnu/bash/bash-4.4.12.tar.gz \
58 && wget http://ftp.gnu.org/gnu/bash/bash-4.4.12.tar.gz.sig \
59 && tar xzf bash-4.4.12.tar.gz \
60 && cd bash-4.4.12 \
61 && ./configure --prefix=/usr/local/$( basename $( pwd ) ) \
62 && make \
63 && make install \
64 && ln -sf /usr/local/src/bash-4.4.12/bash /bin/bash
65
66 # Need to "touch" RPM database to workaround bug in interaction between
67 # overlayfs and yum (https://bugzilla.redhat.com/show_bug.cgi?id=1213602)
68 RUN touch /var/lib/rpm/* && yum -q -y install python3 python3-pip python3-devel
69
70 # Install virtualenv
71 RUN /usr/bin/pip3 install 'virtualenv<20'
72
73 RUN /usr/local/rvm/bin/rvm-exec default 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 $(grep -c processor /proc/cpuinfo)"
76
77 # Preseed the go module cache and the ruby gems, using the currently checked
78 # out branch of the source tree. This avoids potential compatibility issues
79 # between the version of Ruby and certain gems.
80 RUN git clone git://git.arvados.org/arvados.git /tmp/arvados && \
81     cd /tmp/arvados && \
82     if [[ -n "${BRANCH}" ]]; then git checkout ${BRANCH}; fi && \
83     cd /tmp/arvados/services/api && \
84     /usr/local/rvm/bin/rvm-exec default bundle install && \
85     cd /tmp/arvados && \
86     go mod download
87
88 # The version of setuptools that comes with CentOS is way too old
89 RUN pip3 install 'setuptools<45'
90
91 ENV WORKSPACE /arvados
92 CMD ["/usr/local/rvm/bin/rvm-exec", "default", "bash", "/jenkins/run-build-packages.sh", "--target", "centos7"]