Merge branch '12194-search-always-valid'
[arvados.git] / tools / arvbox / lib / arvbox / docker / Dockerfile.base
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 FROM debian:9
6
7 ENV DEBIAN_FRONTEND noninteractive
8
9 RUN apt-get update && \
10     apt-get -yq --no-install-recommends -o Acquire::Retries=6 install \
11     postgresql-9.6 git build-essential runit curl libpq-dev \
12     libcurl4-openssl-dev libssl1.0-dev zlib1g-dev libpcre3-dev \
13     openssh-server python-setuptools netcat-traditional \
14     python-epydoc graphviz bzip2 less sudo virtualenv \
15     libpython-dev fuse libfuse-dev python-pip python-yaml \
16     pkg-config libattr1-dev python-llfuse python-pycurl \
17     libwww-perl libio-socket-ssl-perl libcrypt-ssleay-perl \
18     libjson-perl nginx gitolite3 lsof libreadline-dev \
19     apt-transport-https ca-certificates slurm-wlm \
20     linkchecker python3-virtualenv python-virtualenv xvfb iceweasel \
21     libgnutls28-dev python3-dev vim cython gnupg dirmngr && \
22     apt-get clean
23
24 ENV RUBYVERSION_MINOR 2.3
25 ENV RUBYVERSION 2.3.4
26
27 # Install Ruby from source
28 RUN cd /tmp && \
29  curl -f http://cache.ruby-lang.org/pub/ruby/${RUBYVERSION_MINOR}/ruby-${RUBYVERSION}.tar.gz | tar -xzf - && \
30  cd ruby-${RUBYVERSION} && \
31  ./configure --disable-install-doc && \
32  make && \
33  make install && \
34  cd /tmp && \
35  rm -rf ruby-${RUBYVERSION}
36
37 ENV GEM_HOME /var/lib/gems
38 ENV GEM_PATH /var/lib/gems
39 ENV PATH $PATH:/var/lib/gems/bin
40
41 ENV GOVERSION 1.8.3
42
43 # Install golang binary
44 RUN curl -f http://storage.googleapis.com/golang/go${GOVERSION}.linux-amd64.tar.gz | \
45     tar -C /usr/local -xzf -
46
47 ENV PATH ${PATH}:/usr/local/go/bin
48
49 VOLUME /var/lib/docker
50 VOLUME /var/log/nginx
51 VOLUME /etc/ssl/private
52
53 RUN apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D || \
54     apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
55
56 RUN mkdir -p /etc/apt/sources.list.d && \
57     echo deb https://apt.dockerproject.org/repo debian-stretch main > /etc/apt/sources.list.d/docker.list && \
58     apt-get update && \
59     apt-get -yq --no-install-recommends install docker-engine=17.05.0~ce-0~debian-stretch && \
60     apt-get clean
61
62 RUN rm -rf /var/lib/postgresql && mkdir -p /var/lib/postgresql
63
64 RUN cd /root && \
65     GOPATH=$PWD go get github.com/curoverse/runsvinit && \
66     install bin/runsvinit /usr/local/bin
67
68 ENV PJSVERSION=1.9.7
69
70 RUN set -e && \
71  curl -L -f http://cache.arvados.org/phantomjs-${PJSVERSION}-linux-x86_64.tar.bz2 | tar -C /usr/local -xjf - && \
72  ln -s ../phantomjs-${PJSVERSION}-linux-x86_64/bin/phantomjs /usr/local/bin
73
74 RUN pip install -U setuptools
75
76 ENV NODEVERSION v6.11.2
77
78 # Install nodejs binary
79 RUN curl -L -f https://nodejs.org/dist/${NODEVERSION}/node-${NODEVERSION}-linux-x64.tar.xz | tar -C /usr/local -xJf - && \
80     ln -s ../node-${NODEVERSION}-linux-x64/bin/node ../node-${NODEVERSION}-linux-x64/bin/npm /usr/local/bin
81
82 ARG arvados_version
83 RUN echo arvados_version is git commit $arvados_version
84
85 ADD fuse.conf /etc/
86
87 ADD crunch-setup.sh gitolite.rc \
88     keep-setup.sh common.sh createusers.sh \
89     logger runsu.sh waitforpostgres.sh \
90     application_yml_override.py api-setup.sh \
91     /usr/local/lib/arvbox/
92
93 # Start the supervisor.
94 CMD ["/usr/local/bin/runsvinit"]