2018-01-30 20:17:30 +01:00
|
|
|
# Dockerfile for a generic Ubuntu image with just the basics we need
|
2017-09-20 01:36:00 +02:00
|
|
|
# to make it suitable for CI. In particular:
|
|
|
|
# * a non-root user to run as (a pain to try to do in setup,
|
|
|
|
# because by then we've already cloned the repo);
|
|
|
|
# * Git and other basic utilities.
|
|
|
|
|
2021-07-13 22:03:32 +02:00
|
|
|
# To rebuild from this file for a given release, say Ubuntu 18.04 bionic:
|
|
|
|
# docker build . --build-arg=BASE_IMAGE=ubuntu:18.04 --pull --tag=zulip/ci:bionic
|
2021-06-24 21:52:53 +02:00
|
|
|
# docker push zulip/ci:bionic
|
2017-12-02 02:13:26 +01:00
|
|
|
|
2021-06-24 21:52:53 +02:00
|
|
|
ARG BASE_IMAGE
|
|
|
|
FROM $BASE_IMAGE
|
2017-09-20 01:36:00 +02:00
|
|
|
|
2021-07-13 22:03:32 +02:00
|
|
|
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
|
2017-09-20 01:36:00 +02:00
|
|
|
|
2021-07-13 22:03:32 +02:00
|
|
|
# Set the locale.
|
2021-04-30 21:57:25 +02:00
|
|
|
ENV LC_ALL C.UTF-8
|
2017-09-20 01:36:00 +02:00
|
|
|
|
2020-07-04 22:09:45 +02:00
|
|
|
# Upgrade git if it is less than v2.18 because GitHub Actions'
|
|
|
|
# checkout installs source code using Rest API as an optimization
|
|
|
|
# if the version is less than v2.18, which causes failure in provision
|
|
|
|
# and tests because of the lack of git being initialized.
|
2021-07-13 22:03:32 +02:00
|
|
|
RUN if (. /etc/os-release && [ "$ID $VERSION_ID" = 'ubuntu 18.04' ]); then \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get -y install software-properties-common && \
|
|
|
|
add-apt-repository -y ppa:git-core/ppa; \
|
2020-07-04 22:09:45 +02:00
|
|
|
fi
|
|
|
|
|
2021-07-13 22:03:32 +02:00
|
|
|
# Extra packages used by Zulip.
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get -y install --no-install-recommends \
|
|
|
|
build-essential \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gettext \
|
|
|
|
git \
|
|
|
|
hunspell-en-us \
|
|
|
|
jq \
|
|
|
|
libffi-dev \
|
|
|
|
libfreetype6-dev \
|
|
|
|
libjpeg-dev \
|
|
|
|
libldap2-dev \
|
|
|
|
libpq-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
libxslt1-dev \
|
|
|
|
locales \
|
|
|
|
memcached \
|
|
|
|
moreutils \
|
|
|
|
puppet \
|
|
|
|
python3-dev \
|
|
|
|
python3-pip \
|
|
|
|
rabbitmq-server \
|
|
|
|
redis-server \
|
|
|
|
sudo \
|
|
|
|
supervisor \
|
|
|
|
unzip \
|
|
|
|
xvfb \
|
|
|
|
zlib1g-dev
|
2021-04-02 11:04:05 +02:00
|
|
|
|
2020-06-26 20:41:34 +02:00
|
|
|
ARG USERNAME=github
|
|
|
|
RUN groupadd --gid 3434 $USERNAME \
|
|
|
|
&& useradd --uid 3434 --gid $USERNAME --shell /bin/bash --create-home $USERNAME \
|
|
|
|
&& echo "$USERNAME ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers.d/50-$USERNAME \
|
2017-09-20 01:36:00 +02:00
|
|
|
&& echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
|
|
|
|
|
2020-06-26 20:41:34 +02:00
|
|
|
USER $USERNAME
|
2017-09-20 01:36:00 +02:00
|
|
|
|
|
|
|
CMD ["/bin/sh"]
|