a681c21e4fb15f26eac547ec3f61b055cb798900
[csit.git] / resources / tools / disk-image-builder / csit-sut-dcr / ubuntu_1804_amd64 / Dockerfile
1 # Copyright (c) 2019 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 FROM ubuntu:bionic-20180821
15
16 MAINTAINER csit-dev <csit-dev@lists.fd.io>
17 LABEL Description="CSIT vpp-device ubuntu 18.04 baseline image (x86)"
18 LABEL Version="0.6"
19
20 # Setup the environment
21 ENV DEBIAN_FRONTEND=noninteractive
22 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
23 ENV NOTVISIBLE "in users profile"
24 ENV VPP_PYTHON_PREFIX=/var/cache/vpp/python
25
26 # Base layer
27 RUN apt-get -q update \
28  && apt-get install -y -qq \
29         apt-transport-https \
30         curl \
31         software-properties-common \
32  && rm -rf /var/lib/apt/lists/*
33
34 # Repository settings
35 RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
36  && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
37  && apt-get remove -y \
38         curl
39
40 # Extended layer
41 RUN apt-get -q update \
42  && apt-get install -y -qq \
43         # general tools
44         bridge-utils \
45         cloud-init \
46         locales \
47         net-tools \
48         openssh-server \
49         pciutils \
50         rsyslog \
51         ssh \
52         sudo \
53         supervisor \
54         tar \
55         vim \
56         wget \
57         # csit requirements
58         cmake \
59         dkms \
60         docker-ce \
61         libpcap-dev \
62         libpython2.7-dev \
63         libpython-dev \
64         openjdk-8-jdk-headless \
65         python-pip \
66         python2.7-dev \
67         python-dev \
68         python-virtualenv \
69         qemu-system-x86 \
70         socat \
71         strongswan \
72         unzip \
73         tcpdump \
74         zlib1g-dev \
75         # vpp requirements
76         ca-certificates \
77         libapr1 \
78         libmbedcrypto1 \
79         libmbedtls10 \
80         libmbedx509-0 \
81         libnuma1 \
82         python-cffi \
83         python-enum34 \
84         python3-cffi \
85  && rm -rf /var/lib/apt/lists/*
86
87 # Configure locales
88 RUN locale-gen en_US.UTF-8 \
89  && dpkg-reconfigure locales
90
91 # Fix permissions
92 RUN chown root:syslog /var/log \
93  && chmod 755 /etc/default
94
95 # Create directory structure
96 RUN mkdir -p /tmp/dumps \
97  && mkdir -p /var/cache/vpp/python \
98  && mkdir -p /var/run/sshd
99
100 # CSIT PIP pre-cache
101 RUN pip install \
102         docopt==0.6.2 \
103         ecdsa==0.13 \
104         enum34==1.1.2 \
105         ipaddress==1.0.16 \
106         paramiko==1.16.0 \
107         pexpect==4.6.0 \
108         pycrypto==2.6.1 \
109         pykwalify==1.5.0 \
110         pypcap==1.1.5 \
111         python-dateutil==2.4.2 \
112         PyYAML==3.11 \
113         requests==2.9.1 \
114         robotframework==2.9.2 \
115         scapy==2.3.1 \
116         scp==0.10.2 \
117         six==1.12.0 \
118         dill==0.2.8.2 \
119         numpy==1.14.5 \
120         scipy==1.1.0
121
122 # VPP PIP pre-cache
123 RUN pip install \
124         aenum
125
126 # SSH settings
127 RUN echo 'root:Csit1234' | chpasswd \
128  && sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
129  && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \
130  && echo "export VISIBLE=now" >> /etc/profile
131
132 EXPOSE 22
133
134 COPY supervisord.conf /etc/supervisord/supervisord.conf
135
136 CMD ["sh", "-c", "rm -f /dev/shm/db /dev/shm/global_vm /dev/shm/vpe-api; /usr/bin/supervisord -c /etc/supervisord/supervisord.conf; /usr/sbin/sshd -D"]