15612: Add reference to the ticket regarding the bash upgrade
[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 FROM centos:7
6 MAINTAINER Ward Vandewege <ward@curoverse.com>
7
8 # Install dependencies.
9 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 perl-ExtUtils-MakeMaker libattr-devel nss-devel libcurl-devel which tar unzip scl-utils centos-release-scl postgresql-devel python-devel python-setuptools fuse-devel xz-libs git python-virtualenv wget
10
11 # Install RVM
12 ADD generated/mpapis.asc /tmp/
13 ADD generated/pkuczynski.asc /tmp/
14 RUN gpg --import --no-tty /tmp/mpapis.asc && \
15     gpg --import --no-tty /tmp/pkuczynski.asc && \
16     curl -L https://get.rvm.io | bash -s stable && \
17     /usr/local/rvm/bin/rvm install 2.5 && \
18     /usr/local/rvm/bin/rvm alias create default ruby-2.5 && \
19     /usr/local/rvm/bin/rvm-exec default gem install fpm --version 1.10.2
20
21 # Install Bash 4.4.12 // see https://dev.arvados.org/issues/15612
22 RUN cd /usr/local/src \
23 && wget http://ftp.gnu.org/gnu/bash/bash-4.4.12.tar.gz \
24 && wget http://ftp.gnu.org/gnu/bash/bash-4.4.12.tar.gz.sig \
25 && tar xzf bash-4.4.12.tar.gz \
26 && cd bash-4.4.12 \
27 && ./configure --prefix=/usr/local/$( basename $( pwd ) ) \
28 && make \
29 && make install \
30 && ln -sf /usr/local/src/bash-4.4.12/bash /bin/bash
31
32 # Install golang binary
33 ADD generated/go1.12.7.linux-amd64.tar.gz /usr/local/
34 RUN ln -s /usr/local/go/bin/go /usr/local/bin/
35
36 # Install nodejs and npm
37 ADD generated/node-v6.11.2-linux-x64.tar.xz /usr/local/
38 RUN ln -s /usr/local/node-v6.11.2-linux-x64/bin/* /usr/local/bin/
39
40 # Need to "touch" RPM database to workaround bug in interaction between
41 # overlayfs and yum (https://bugzilla.redhat.com/show_bug.cgi?id=1213602)
42 RUN touch /var/lib/rpm/* && yum -q -y install rh-python35
43 RUN scl enable rh-python35 "easy_install-3.5 pip" && easy_install-2.7 pip
44
45 # Add epel, we need it for the python-pam dependency
46 RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
47 RUN rpm -ivh epel-release-latest-7.noarch.rpm
48
49 RUN git clone --depth 1 git://git.curoverse.com/arvados.git /tmp/arvados && cd /tmp/arvados/services/api && /usr/local/rvm/bin/rvm-exec default bundle && cd /tmp/arvados/apps/workbench && /usr/local/rvm/bin/rvm-exec default bundle
50
51 # The version of setuptools that comes with CentOS is way too old
52 RUN pip install --upgrade setuptools
53
54 ENV WORKSPACE /arvados
55 CMD ["scl", "enable", "rh-python35", "/usr/local/rvm/bin/rvm-exec default bash /jenkins/run-build-packages.sh --target centos7"]