c7aa3363cfe1b60c3a52bf7035cb7858cea53af1
[csit.git] / resources / tools / disk-image-builder / csit-sut-dcr / ubuntu_1804_amd64 / Dockerfile
1 # Copyright (c) 2018 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"
18 LABEL Vendor="cisco.com"
19 LABEL Version="0.4"
20
21 # Setup the environment
22 ENV DEBIAN_FRONTEND=noninteractive
23 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
24 ENV NOTVISIBLE "in users profile"
25 ENV VPP_PYTHON_PREFIX=/var/cache/vpp/python
26
27 # Base layer
28 RUN apt-get -q update \
29  && apt-get install -y -qq \
30         apt-transport-https \
31         curl \
32         software-properties-common \
33  && rm -rf /var/lib/apt/lists/*
34
35 # Repository settings
36 RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
37  && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
38  && apt-get remove -y \
39         curl
40
41 # Extended layer
42 RUN apt-get -q update \
43  && apt-get install -y -qq \
44         # general tools
45         bridge-utils \
46         cloud-init \
47         locales \
48         net-tools \
49         openssh-server \
50         pciutils \
51         rsyslog \
52         ssh \
53         sudo \
54         supervisor \
55         tar \
56         vim \
57         wget \
58         # csit requirements
59         cmake \
60         dkms \
61         docker-ce \
62         libpcap-dev \
63         libpython2.7-dev \
64         libpython-dev \
65         openjdk-8-jdk-headless \
66         python-pip \
67         python2.7-dev \
68         python-dev \
69         python-virtualenv \
70         qemu-system-x86 \
71         socat \
72         strongswan \
73         unzip \
74         tcpdump \
75         zlib1g-dev \
76         # vpp requirements
77         ca-certificates \
78         libapr1 \
79         libmbedcrypto1 \
80         libmbedtls10 \
81         libmbedx509-0 \
82         libnuma1 \
83         python-cffi \
84         python-enum34 \
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 # 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 # SSH settings
123 RUN echo 'root:Csit1234' | chpasswd \
124  && sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
125  && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \
126  && echo "export VISIBLE=now" >> /etc/profile
127
128 EXPOSE 22
129
130 COPY supervisord.conf /etc/supervisord/supervisord.conf
131
132 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"]