blob: 16cff236c5d322ba57344429021e2a8b781640cf [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# NOTE: These are intended to be built using the arguments as
# described in ../build.sh. See that script for more details.
FROM ubuntu:focal
# Choose whether to install SpiderMonkey 1.8.5, default yes
ARG js=js
# Choose whether to install Erlang, default yes
ARG erlang=erlang
# Select version of Node, Erlang and Elixir to install
ARG erlangversion=20.3.8.25-1
ARG elixirversion=v1.9.1
ARG nodeversion=10
# Create Jenkins user and group
RUN groupadd --gid 910 jenkins; \
useradd --uid 910 --gid jenkins --create-home jenkins
# Copy couchdb-ci repo into root's home directory
ADD --chown=root:root bin /root/couchdb-ci/bin/
ADD --chown=root:root files /root/couchdb-ci/files/
# Jenkins builds in /usr/src/couchdb.
RUN mkdir -p /usr/src/couchdb; \
chown -R jenkins:jenkins /usr/src/couchdb
# Install all dependencies, and optionally SM 1.8.5
# This allows us to use the same Dockerfile for building SM
RUN ERLANGVERSION=$erlangversion \
ELIXIRVERSION=$elixirversion \
NODEVERSION=$nodeversion \
/root/couchdb-ci/bin/install-dependencies.sh $js $erlang
# Allow Jenkins to sudo
RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins
USER jenkins
# overwrite this with 'CMD []' in a dependent Dockerfile
CMD ["/bin/bash"]