1
1
FROM alpine:3.6
2
2
3
+ COPY ./setup-Alpine.sh /home/src/setup-Alpine.sh
4
+ RUN chmod a+x /home/src/setup-Alpine.sh
5
+
3
6
RUN apk update
4
7
5
8
RUN apk add --no-cache \
@@ -30,6 +33,7 @@ RUN apk add --no-cache \
30
33
python-dev \
31
34
sudo \
32
35
util-linux-dev \
36
+ wget \
33
37
zlib-dev
34
38
35
39
RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \
@@ -42,8 +46,8 @@ RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/testing add --no-cache \
42
46
RUN /usr/sbin/adduser -D -G adm -s /bin/sh helixbot
43
47
44
48
# 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
49
+ RUN wget -O /home/helixbot /get-pip.py https://bootstrap.pypa.io /get-pip.py && \
50
+ /usr/bin/python /home/helixbot/get-pip.py
47
51
ENV pkgmgr apk
48
52
ENV HELIX_SCRIPT_ROOT /home/helixbot/dotnetbuild/scripts
49
53
ENV HELIX_WORK_ROOT /home/helixbot/dotnetbuild/work
@@ -53,37 +57,6 @@ ENV PYTHONPATH /usr/bin/python:/home/helixbot/dotnetbuild/scripts
53
57
ENV HELIX_PYTHONPATH /usr/bin/python
54
58
WORKDIR /home/helixbot/
55
59
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
60
+ # Run script that generates starttestrunner.sh
61
+ RUN /home/src/setup-Alpine.sh
62
+ USER helixbot
0 commit comments