|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | + |
| 17 | +# NOTE: These are intended to be built using the arguments as |
| 18 | +# described in ../build.sh. See that script for more details. |
| 19 | + |
| 20 | +FROM rockylinux:9 |
| 21 | + |
| 22 | +# Install Java |
| 23 | +ENV JAVA_HOME=/opt/java/openjdk |
| 24 | +COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME |
| 25 | +ENV PATH="${JAVA_HOME}/bin:${PATH}" |
| 26 | + |
| 27 | +# Choose whether to install SpiderMonkey 1.8.5, default yes |
| 28 | +ARG js=js |
| 29 | +# Choose whether to install Erlang, default yes |
| 30 | +ARG erlang=erlang |
| 31 | +# Select version of Node, Erlang and Elixir to install |
| 32 | +ARG erlangversion=24.3.4.10 |
| 33 | +ARG elixirversion=v1.13.4 |
| 34 | +ARG nodeversion=14 |
| 35 | + |
| 36 | +# Create Jenkins user and group |
| 37 | +RUN groupadd --gid 910 jenkins; \ |
| 38 | + useradd --uid 910 --gid jenkins --create-home jenkins |
| 39 | + |
| 40 | +# Copy couchdb-ci repo into root's home directory |
| 41 | +ADD --chown=root:root bin /root/couchdb-ci/bin/ |
| 42 | +ADD --chown=root:root files /root/couchdb-ci/files/ |
| 43 | + |
| 44 | +# Jenkins builds in /usr/src/couchdb. |
| 45 | +RUN mkdir -p /usr/src/couchdb; \ |
| 46 | + chown -R jenkins:jenkins /usr/src/couchdb |
| 47 | + |
| 48 | +# Add /usr/local/lib to global LD_LIBRARY_PATH for CentOS |
| 49 | +RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf |
| 50 | + |
| 51 | +# Install all dependencies, and optionally SM 1.8.5 |
| 52 | +# This allows us to use the same Dockerfile for building SM |
| 53 | +RUN ERLANGVERSION=$erlangversion \ |
| 54 | + ELIXIRVERSION=$elixirversion \ |
| 55 | + NODEVERSION=$nodeversion \ |
| 56 | + /root/couchdb-ci/bin/install-dependencies.sh $js $erlang |
| 57 | + |
| 58 | +# Allow Jenkins to sudo |
| 59 | +RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins |
| 60 | + |
| 61 | +USER jenkins |
| 62 | + |
| 63 | +# overwrite this with 'CMD []' in a dependent Dockerfile |
| 64 | +CMD ["/bin/bash"] |
0 commit comments