|
| 1 | +FROM alpine:3.6 |
| 2 | + |
| 3 | +RUN apk update |
| 4 | + |
| 5 | +RUN apk add --no-cache \ |
| 6 | + autoconf \ |
| 7 | + bash \ |
| 8 | + build-base \ |
| 9 | + clang \ |
| 10 | + clang-dev \ |
| 11 | + cmake \ |
| 12 | + coreutils \ |
| 13 | + curl-dev \ |
| 14 | + gcc \ |
| 15 | + gettext-dev \ |
| 16 | + git \ |
| 17 | + icu-dev \ |
| 18 | + krb5-dev \ |
| 19 | + libtool \ |
| 20 | + libunwind-dev \ |
| 21 | + libffi \ |
| 22 | + linux-headers \ |
| 23 | + llvm \ |
| 24 | + make \ |
| 25 | + openssl \ |
| 26 | + openssl-dev \ |
| 27 | + paxctl \ |
| 28 | + py-cffi \ |
| 29 | + python \ |
| 30 | + python-dev \ |
| 31 | + sudo \ |
| 32 | + util-linux-dev \ |
| 33 | + zlib-dev |
| 34 | + |
| 35 | +RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \ |
| 36 | + userspace-rcu-dev \ |
| 37 | + lttng-ust-dev |
| 38 | + |
| 39 | +RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/testing add --no-cache \ |
| 40 | + lldb-dev |
| 41 | + |
| 42 | +RUN /usr/sbin/adduser -D -G adm -s /bin/sh helixbot |
| 43 | + |
| 44 | +# Restore pip and set environment |
| 45 | +ADD https://bootstrap.pypa.io/get-pip.py /home/helixbot/get-pip.py |
| 46 | +RUN /usr/bin/python /home/helixbot/get-pip.py |
| 47 | +ENV pkgmgr apk |
| 48 | +ENV HELIX_SCRIPT_ROOT /home/helixbot/dotnetbuild/scripts |
| 49 | +ENV HELIX_WORK_ROOT /home/helixbot/dotnetbuild/work |
| 50 | +ENV HELIX_LOG_ROOT /home/helixbot/dotnetbuild/logs |
| 51 | +ENV HELIX_CONFIG_ROOT /home/helixbot/dotnetbuild/config |
| 52 | +ENV PYTHONPATH /usr/bin/python:/home/helixbot/dotnetbuild/scripts |
| 53 | +ENV HELIX_PYTHONPATH /usr/bin/python |
| 54 | +WORKDIR /home/helixbot/ |
| 55 | + |
| 56 | +# Write and run script that generates starttestrunner.sh |
| 57 | +RUN mkdir /home/src/ |
| 58 | +RUN echo -e "#!/bin/bash \n\ |
| 59 | +user_name=helixbot \n\ |
| 60 | +rootdir=/home/\$user_name \n\ |
| 61 | +script_root=\$rootdir/dotnetbuild/scripts \n\ |
| 62 | +work_root=\$rootdir/dotnetbuild/work \n\ |
| 63 | +log_root=\$rootdir/dotnetbuild/logs \n\ |
| 64 | +config_root=\$rootdir/dotnetbuild/config \n\ |
| 65 | +python_path=/usr/bin/python \n\ |
| 66 | +mkdir -p \$script_root \n\ |
| 67 | +mkdir -p \$work_root \n\ |
| 68 | +mkdir -p \$log_root \n\ |
| 69 | +mkdir -p \$config_root \n\ |
| 70 | +chown \$user_name \$script_root \n\ |
| 71 | +chown \$user_name \$work_root \n\ |
| 72 | +chown \$user_name \$log_root \n\ |
| 73 | +chown \$user_name \$config_root \n\ |
| 74 | +chown \$user_name /home/helixbot/get-pip.py \n\ |
| 75 | +echo \"fs.inotify.max_user_instances=1024\" >> /etc/sysctl.conf \n\ |
| 76 | +echo cd \\\$HELIX_SCRIPT_ROOT >> /home/\$user_name/starttestrunner.sh \n\ |
| 77 | +# LANG will be un-set on some Linux OSes, leading to inability to unzip files with unicode content \n\ |
| 78 | +echo export LANG=en_US.UTF-8 >> /home/\$user_name/starttestrunner.sh \n\ |
| 79 | +echo sudo -H -u \$user_name \\\$HELIX_PYTHONPATH /home/\$user_name/get-pip.py --user >> /home/\$user_name/starttestrunner.sh \n\ |
| 80 | +echo sudo -H -u \$user_name \\\$HELIX_PYTHONPATH -m pip install -r \$rootdir/dotnetbuild/scripts/runtime_python_requirements.txt --user >> /home/\$user_name/starttestrunner.sh \n\ |
| 81 | +echo \"\\\$HELIX_PYTHONPATH start_helix.py | tee -a \\\$HELIX_LOG_ROOT/test_runner.log\" >> /home/\$user_name/starttestrunner.sh \n\ |
| 82 | +echo \"\\\$HELIX_PYTHONPATH -c \\\"from helix.platformutil import reboot_machine; reboot_machine()\\\" \" >> /home/\$user_name/starttestrunner.sh \n\ |
| 83 | +chmod 755 /home/\$user_name/starttestrunner.sh \n\ |
| 84 | +# comment out the line in the /etc/sudoers file if present that requires tty to sudo. \n\ |
| 85 | +sed -i -e \"s/Defaults.*requiretty.*/#Defaults requiretty/g\" /etc/sudoers \n\ |
| 86 | +# For now, we will let DotNetBot sudo whatever it wants. \n\ |
| 87 | +echo \"\$user_name ALL=(ALL) NOPASSWD: ALL\" | (EDITOR=\"tee -a\" visudo)" > /home/src/setup-Alpine.sh |
| 88 | + |
| 89 | +RUN /bin/sh /home/src/setup-Alpine.sh |
0 commit comments