aboutsummaryrefslogtreecommitdiffstats
path: root/docker/Dockerfile
blob: 3ad7181a0adab915816f179379c4926b8b90008e (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
FROM ubuntu:20.04 as base

## Be careful of Windows newlines
MAINTAINER "ONAP"
LABEL name="Docker image for the ONAP Robot Testing Framework"
LABEL usage="docker run -e ROBOT_TEST=<testname> -ti onapete"
ENV BUILDTIME=true
ENV DEBIAN_FRONTEND noninteractive

ARG KUBERNETES_VERSION="v1.23.8"
ARG HELM_VERSION="v3.8.2"

ARG PYTHON_UTILS_REPO=git.onap.org/testsuite/python-testing-utils.git
ARG PYTHON_UTILS_TAG=master

ARG DEMO_REPO=git.onap.org/demo
ARG DEMO_TAG=master

# Install apt packages, Python, Pip, etc
RUN apt-get update &&  \
    apt-get install --no-install-recommends --assume-yes  \
    chromium-browser  \
    chromium-chromedriver  \
    dnsutils  \
    git  \
    gcc  \
    libffi-dev  \
    libssl-dev  \
    lighttpd  \
    make  \
    net-tools  \
    netbase  \
    unzip  \
    zip  \
    x11-utils  \
    x11-xserver-utils  \
    xvfb  \
    xxd  \
    wget  \
    vim  \
    python3.8  \
    python3.8-dev  \
    python3-pip &&  \
    ln -s /usr/bin/python3 /usr/bin/python && \
    apt-get autoremove --assume-yes &&  \
    rm -rf /var/lib/apt/lists/* &&  \
    apt-get clean

# Get kubectl
ADD https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl /usr/local/bin/kubectl
# Get helm
ADD https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 get_helm.sh

COPY requirements.txt requirements.txt

RUN mkdir -p /var/opt/ONAP &&  \
    pip3 install --no-cache-dir -r requirements.txt setuptools wheel virtualenv &&  \
    pip3 install --no-cache-dir git+https://$PYTHON_UTILS_REPO@$PYTHON_UTILS_TAG#egg=robotframework-onap\&subdirectory=robotframework-onap && \
    git clone --depth 1 https://$DEMO_REPO -b $DEMO_TAG /var/opt/ONAP/demo &&  \
    chmod +x /usr/local/bin/kubectl &&  \
    chmod 700 get_helm.sh &&  \
    ./get_helm.sh --version $HELM_VERSION


COPY html/ /var/opt/ONAP/html
COPY robot/ /var/opt/ONAP/robot
COPY *.sh /var/opt/ONAP/
COPY docker/lighttpd.conf /etc/lighttpd/lighttpd.conf
COPY docker/authorization /etc/lighttpd/authorization

RUN mkdir -p /app &&  \
    cp /var/opt/ONAP/setup-hvves.sh /app &&  \
    chmod 600 /var/opt/ONAP/robot/assets/keys/* &&  \
    chmod 777 /var/opt/ONAP/*.sh &&  \
    cd /var/opt/ONAP &&  \
    ./setup.sh

CMD ["lighttpd", "-D", "-f",  "/etc/lighttpd/lighttpd.conf"]