1ccbc24ab6302863127422605788d199031992e9
[iec.git] / src / use_cases / seba_on_arm / docker / build / cord-tester / Dockerfile.cord-tester
1 ##############################################################################
2 # Copyright (c) 2019 AT&T, ENEA AB, Nokia and others                         #
3 #                                                                            #
4 # Licensed under the Apache License, Version 2.0 (the "License");            #
5 # you maynot use this file except in compliance with the License.            #
6 #                                                                            #
7 # You may obtain a copy of the License at                                    #
8 #       http://www.apache.org/licenses/LICENSE-2.0                           #
9 #                                                                            #
10 # Unless required by applicable law or agreed to in writing, software        #
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
13 # See the License for the specific language governing permissions and        #
14 # limitations under the License.                                             #
15 ##############################################################################
16
17 FROM ubuntu:bionic
18 ENV DIRPATH /workspace
19 WORKDIR $DIRPATH
20
21 # Preferred Kubernetes versions 1.13 for IEC Type 2
22 ARG KUBE_VERSION=1.13.0-00
23 ARG TEST_USER=ubuntu
24
25 # Install packages required by cord-tester
26 RUN apt update && apt install -y lsb-release openssh-server sudo curl \
27     python-pip virtualenv python3-dev \
28     git libffi-dev libssl-dev libpq-dev
29
30 # For now still using old Kubernetes from Xenial to map with IEC version
31 RUN echo "deb http://packages.cloud.google.com/apt kubernetes-xenial main" >\
32     /etc/apt/sources.list.d/kubernetes.list
33 RUN curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg > key.gpg
34 RUN apt-key add key.gpg
35 RUN apt update && apt install kubectl=$KUBE_VERSION
36
37 RUN pip install virtualenv
38 RUN apt-mark hold kubectl && apt autoremove -y \
39     && rm -rf /var/lib/apt/lists/*
40 RUN groupadd -r $TEST_USER && useradd -m -s /bin/bash -g $TEST_USER \                                                                                                                                            
41     --system -G sudo -p $(openssl passwd -1 $TEST_USER) $TEST_USER                                                                                                                                               
42 RUN echo "$TEST_USER\tALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/90-docker-users
43 USER $TEST_USER