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