aa8e0a4179cfc5e1240cb7f31ec8896aa1896448
[it/test.git] / ric_robot_suite / docker / ric-robot / Dockerfile
1 #
2 #
3 # Copyright 2019 AT&T Intellectual Property
4 # Copyright 2019 Nokia
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18
19 FROM ubuntu
20 ## Be careful of Windows newlines
21
22 MAINTAINER "RIC"
23
24 LABEL name="Docker image for the RIC Robot Testing Framework"
25 LABEL usage="docker run -e ROBOT_TEST=<testname> -ti ric-robot"
26
27
28 ENV TZ=America/New_York
29 RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
30
31 ENV BUILDTIME=true
32
33 # Install Python, Pip, Robot framework, chromium, lighttpd web server
34
35 # temporarily removed chromium-browser and chromium-chromedriver as
36 # they've moved to snaps and we don't have snapd support in this container
37 # yet. This will break robot tests that depend on the browser, but we don't
38 # have those in the RIC at this point anyway.
39
40 RUN apt-get update \
41     && apt-get install \
42         --no-install-recommends \
43         --assume-yes \
44             dnsutils \
45             git \
46             gcc \
47             libffi-dev \
48             libssl-dev \
49             lighttpd \
50             make \
51             net-tools \
52             php  \
53             php-cgi \
54             python3-pip \
55             python-dev \
56             python-setuptools \
57             python-redis \
58             unzip \
59             vim   \
60             x11-utils \
61             x11-xserver-utils \
62             xvfb \
63             xxd
64
65
66 RUN pip3 install robotframework==3.0.4 \
67     && python --version
68
69 # Copy the robot code
70
71 COPY robot /var/opt/RIC/robot
72 COPY docker/ric-robot/red.xml /var/opt/RIC
73 COPY ric-python-utils /var/opt/RIC/ric-python-utils
74 COPY docker/ric-robot/runTags.sh /var/opt/RIC
75 COPY docker/ric-robot/setup.sh /var/opt/RIC
76 COPY docker/ric-robot/version.properties /var/opt/RIC
77 COPY docker/ric-robot/README.md /var/opt/RIC
78 COPY docker/ric-robot/lighttpd.conf /etc/lighttpd/lighttpd.conf
79 COPY docker/ric-robot/authorization /etc/lighttpd/authorization
80
81 RUN chmod 777 /var/opt/RIC/setup.sh \
82     && chmod 777 /var/opt/RIC/runTags.sh \
83     && chmod 600 /var/opt/RIC/robot/assets/keys/*
84
85 RUN cd /var/opt/RIC \
86     && ./setup.sh \
87     && apt-get autoremove --assume-yes \
88     && rm -rf /var/lib/apt/lists/*  \
89     && apt-get clean
90
91 RUN mkdir /root/.kube
92
93 CMD ["lighttpd", "-D", "-f",  "/etc/lighttpd/lighttpd.conf"]
94
95
96