|
| 1 | +FROM registry.fedoraproject.org/fedora:43 |
| 2 | +LABEL maintainer="copr-devel@lists.fedorahosted.org" |
| 3 | +LABEL description="COPR Backend services" |
| 4 | + |
| 5 | +ARG ADDITIONAL_COPR_REPOSITORIES="@copr/copr-dev" |
| 6 | + |
| 7 | +ENV LANG=en_US.UTF-8 |
| 8 | +ENV PYTHONPATH="/usr/share/copr/" |
| 9 | +ENV TERM=linux |
| 10 | + |
| 11 | +RUN set -ex ; \ |
| 12 | + test -z "${ADDITIONAL_COPR_REPOSITORIES}" \ |
| 13 | + || dnf -y install dnf-plugins-core \ |
| 14 | + && for repo in $ADDITIONAL_COPR_REPOSITORIES ; do dnf -y copr enable $repo; done ; \ |
| 15 | + dnf -y update && \ |
| 16 | + dnf -y install htop \ |
| 17 | + make \ |
| 18 | + wget \ |
| 19 | + net-tools \ |
| 20 | + iputils \ |
| 21 | + vim \ |
| 22 | + git \ |
| 23 | + sudo \ |
| 24 | + openssh-server \ |
| 25 | + resalloc \ |
| 26 | + psmisc \ |
| 27 | + nginx \ |
| 28 | + findutils \ |
| 29 | + tini \ |
| 30 | + pulp-cli \ |
| 31 | + rng-tools \ |
| 32 | + expect \ |
| 33 | + && dnf -y install copr-backend \ |
| 34 | + && dnf clean all |
| 35 | + |
| 36 | +RUN setcap cap_net_raw,cap_net_admin+p /usr/bin/ping |
| 37 | + |
| 38 | +RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -q |
| 39 | + |
| 40 | +RUN echo 'root:passwd' | chpasswd && chmod 700 /root /root/.ssh |
| 41 | + |
| 42 | +RUN set -x ; \ |
| 43 | + echo 'copr:passwd' | chpasswd && \ |
| 44 | + echo 'copr ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers && \ |
| 45 | + mkdir -p /home/copr/.ssh && chmod 700 /home/copr /home/copr/.ssh && \ |
| 46 | + ssh-keygen -f /home/copr/.ssh/id_rsa -N '' -q -C copr@localhost && \ |
| 47 | + touch /home/copr/.ssh/authorized_keys && chmod 600 /home/copr/.ssh/authorized_keys && \ |
| 48 | + cat /home/copr/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys && \ |
| 49 | + cat /home/copr/.ssh/id_rsa.pub >> /home/copr/.ssh/authorized_keys && \ |
| 50 | + chown copr:copr -R /home/copr |
| 51 | + |
| 52 | +RUN usermod -a -G mock copr |
| 53 | + |
| 54 | +COPY files/ / |
| 55 | + |
| 56 | +RUN chmod 700 /root && \ |
| 57 | + chmod 700 /home/copr && \ |
| 58 | + chmod 400 /home/copr/.ssh/id_rsa && \ |
| 59 | + chmod 600 /home/copr/.ssh/id_rsa.pub && \ |
| 60 | + chown -R copr:copr /home/copr |
| 61 | + |
| 62 | +RUN chmod 0755 /usr/bin/sign |
| 63 | + |
| 64 | +RUN chown copr:root /etc/sign.conf && \ |
| 65 | + chmod 0660 /etc/sign.conf |
| 66 | + |
| 67 | +RUN mkdir -p /var/lock/copr-backend && \ |
| 68 | + chown copr:copr /var/lock/copr-backend |
| 69 | + |
| 70 | +# Entropy for GPG key generation |
| 71 | +RUN rngd -r /dev/urandom || true |
| 72 | + |
| 73 | +USER copr |
| 74 | + |
| 75 | +ENTRYPOINT ["/usr/bin/tini", "--"] |
| 76 | +CMD ["/run-backend"] |
0 commit comments