|
| 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 ubuntu:noble |
| 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 | +# These are needed for the Clouseau integration |
| 28 | +ENV CLOUSEAU_JAVA_HOME=/opt/java/openjdk8 |
| 29 | +COPY --from=ibm-semeru-runtimes:open-8-jre /opt/java/openjdk $CLOUSEAU_JAVA_HOME |
| 30 | +ENV PATH=/usr/local/lib/erlang/bin:"${PATH}" |
| 31 | + |
| 32 | +# Choose whether to install SpiderMonkey 1.8.5, default yes |
| 33 | +ARG js=js |
| 34 | +# Choose whether to install Erlang, default yes |
| 35 | +ARG erlang=erlang |
| 36 | +# Select version of Node, Erlang and Elixir to install |
| 37 | +ARG erlangversion=25.3.2.13 |
| 38 | +ARG elixirversion=v1.17.2 |
| 39 | +ARG nodeversion=18 |
| 40 | + |
| 41 | +# Create Jenkins user and group |
| 42 | +RUN groupadd --gid 910 jenkins; \ |
| 43 | + useradd --uid 910 --gid jenkins --create-home jenkins |
| 44 | + |
| 45 | +# Copy couchdb-ci repo into root's home directory |
| 46 | +ADD --chown=root:root bin /root/couchdb-ci/bin/ |
| 47 | +ADD --chown=root:root files /root/couchdb-ci/files/ |
| 48 | + |
| 49 | +# Jenkins builds in /usr/src/couchdb. |
| 50 | +RUN mkdir -p /usr/src/couchdb; \ |
| 51 | + chown -R jenkins:jenkins /usr/src/couchdb |
| 52 | + |
| 53 | +# Install all dependencies, and optionally SM 1.8.5 |
| 54 | +# This allows us to use the same Dockerfile for building SM |
| 55 | +RUN ERLANGVERSION=$erlangversion \ |
| 56 | + ELIXIRVERSION=$elixirversion \ |
| 57 | + NODEVERSION=$nodeversion \ |
| 58 | + /root/couchdb-ci/bin/install-dependencies.sh $js $erlang |
| 59 | + |
| 60 | +# Allow Jenkins to sudo |
| 61 | +RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins |
| 62 | + |
| 63 | +USER jenkins |
| 64 | + |
| 65 | +# overwrite this with 'CMD []' in a dependent Dockerfile |
| 66 | +CMD ["/bin/bash"] |
0 commit comments