SF initial configurator | a26c41e | 2022-10-06 13:33:13 +0300 | [diff] [blame] | 1 | # Copyright (C) 2019 Red Hat |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | FROM registry.centos.org/centos:7 |
| 16 | |
| 17 | # Zuul minimal package |
| 18 | RUN yum install -y sudo rsync git traceroute iproute python3-setuptools python3-pip rpm-build python3-rpm-macros |
| 19 | |
| 20 | # Zuul except /bin/pip to be available |
| 21 | RUN ln -sf /bin/pip3 /bin/pip && /bin/pip3 install --user "tox>=3.8.0" |
| 22 | |
| 23 | # Install base Python linter for the demo project |
| 24 | RUN /bin/pip install flake8 yamllint |
| 25 | |
| 26 | # Zuul uses revoke-sudo. We can simulate that by moving the default sudoers to zuul |
| 27 | # And this will prevent root from using sudo when the file is removed by revoke-sudo |
| 28 | RUN mv /etc/sudoers /etc/sudoers.d/zuul && grep includedir /etc/sudoers.d/zuul > /etc/sudoers && sed -e 's/.*includedir.*//' -i /etc/sudoers.d/zuul && chmod 440 /etc/sudoers |
| 29 | |
| 30 | # Create fake zuul users |
| 31 | RUN echo "zuul:x:0:0:root:/root:/bin/bash" >> /etc/passwd |
| 32 | |
| 33 | # Enable root local bin |
| 34 | ENV PATH=/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| 35 | WORKDIR /root |