blob: e5aac9d812adb18c6b62f4154d98760238e378a5 [file] [log] [blame]
FROM gerritcodereview/gerrit:$GERRIT_VERSION.$GERRIT_PATCH-almalinux8
ARG withXRay=false
USER root
RUN yum install -y python36 python3-libs python36-devel python3-pip unzip wget
COPY ssh-config /var/gerrit/.ssh/config
RUN chown -R gerrit:gerrit /var/gerrit/.ssh
# Installing scripts to get SSH Keys from Secret Manager
COPY requirements.txt /tmp
RUN chown gerrit:gerrit /tmp/requirements.txt
COPY /tmp
RUN chown gerrit:gerrit /tmp/
RUN chmod +x /tmp/ \
&& pip3 install -r /tmp/requirements.txt
COPY plugins /var/gerrit/plugins
COPY lib /var/gerrit/lib
COPY etc /var/gerrit/etc
RUN if [ "$withXRay" = "true" ]; then \
echo "Building docker with xray-agent" && \
wget -P /tmp/ && \
unzip /tmp/ -d /tmp; \
RUN chown -R gerrit:gerrit \
/var/gerrit/plugins \
/var/gerrit/lib \
USER gerrit
RUN bash -c '[ "$GERRIT_WAR_URL" == "" ] || curl $GERRIT_WAR_URL > /var/gerrit/bin/gerrit.war'
# Install AWS cli
RUN pip3 install awscli --upgrade --user
ENV PATH ${PATH}:/var/gerrit/.local/bin
WORKDIR /var/gerrit
COPY ./ /bin