Yi Tseng | aae6ef5 | 2021-09-01 13:48:27 -0700 | [diff] [blame^] | 1 | # SPDX-FileCopyrightText: Copyright 2021-present Open Networking Foundation. |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | FROM ubuntu:18.04 |
| 4 | |
| 5 | ARG KUBECTL=v1.22.1 |
| 6 | ENV PACKAGES \ |
| 7 | python \ |
| 8 | python-pip \ |
| 9 | ssh \ |
| 10 | openssh-server \ |
| 11 | curl \ |
| 12 | supervisor |
| 13 | ADD requirements.txt / |
| 14 | |
| 15 | RUN apt update && \ |
| 16 | apt install --no-install-recommends -y $PACKAGES && \ |
| 17 | curl -L "https://dl.k8s.io/release/$KUBECTL/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl && \ |
| 18 | chmod 0755 /usr/local/bin/kubectl && \ |
| 19 | python -m pip install setuptools && \ |
| 20 | python -m pip install -r requirements.txt && \ |
| 21 | mkdir -p /var/run/sshd && \ |
| 22 | mkdir -p /var/log/supervisor && \ |
| 23 | useradd -m jenkins && \ |
| 24 | chsh -s /bin/bash jenkins && \ |
| 25 | echo jenkins:jenkins | chpasswd |
| 26 | |
| 27 | ADD docker/fs / |
| 28 | RUN chown -R jenkins.jenkins /home/jenkins && \ |
| 29 | python -m pip install -r /tmp/additional-py-pkgs.txt |
| 30 | |
| 31 | CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] |
| 32 | |
| 33 | EXPOSE 22 |