-
Notifications
You must be signed in to change notification settings - Fork 7
/
tf-api
58 lines (46 loc) · 1.32 KB
/
tf-api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM python:3.8-slim-buster
ENV DEBIAN_FRONTEND noninteractive
ENV HOME /root
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV PATH /data/testflinger:$PATH
ENV TESTFLINGER_CONFIG=/data/testflinger/testflinger.conf
# install deps & cleanup
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
git \
procps \
wget \
python3 \
python3-dev \
python3-pip \
python3-requests \
python3-click
# clean up APT
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# link python3 bin
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN useradd -ms /bin/bash ubuntu
# facilitate logging
RUN mkdir -p /var/log/testflinger \
&& chmod 755 /var/log/testflinger
# clone src in volume dir
WORKDIR /data/testflinger
RUN git init \
&& git remote add origin https://github.com/canonical/testflinger.git \
&& git fetch origin \
&& git checkout -b main --track origin/main \
&& git checkout c1a1d6ab6de04dca3fcfd8fac3db962f0c35272e
# Remove gunicorn from install scripts
# RUN sed -i '22 s/^/#/' ./setup.py
# install gunicorn threading deps
RUN pip install gevent packaging
# run setup
RUN ./setup.py install
# copy tf config files
COPY ./code/testflinger.conf /data/testflinger
# adjust perms on src files
RUN chown -R ubuntu:ubuntu /data/testflinger