aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/Dockerfile
blob: c7aa3363cfe1b60c3a52bf7035cb7858cea53af1 (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:bionic-20180821

MAINTAINER csit-dev <csit-dev@lists.fd.io>
LABEL Description="CSIT vpp-device ubuntu 18.04 baseline image"
LABEL Vendor="cisco.com"
LABEL Version="0.4"

# Setup the environment
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
ENV NOTVISIBLE "in users profile"
ENV VPP_PYTHON_PREFIX=/var/cache/vpp/python

# Base layer
RUN apt-get -q update \
 && apt-get install -y -qq \
        apt-transport-https \
        curl \
        software-properties-common \
 && rm -rf /var/lib/apt/lists/*

# Repository settings
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
 && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
 && apt-get remove -y \
        curl

# Extended layer
RUN apt-get -q update \
 && apt-get install -y -qq \
        # general tools
        bridge-utils \
        cloud-init \
        locales \
        net-tools \
        openssh-server \
        pciutils \
        rsyslog \
        ssh \
        sudo \
        supervisor \
        tar \
        vim \
        wget \
        # csit requirements
        cmake \
        dkms \
        docker-ce \
        libpcap-dev \
        libpython2.7-dev \
        libpython-dev \
        openjdk-8-jdk-headless \
        python-pip \
        python2.7-dev \
        python-dev \
        python-virtualenv \
        qemu-system-x86 \
        socat \
        strongswan \
        unzip \
        tcpdump \
        zlib1g-dev \
        # vpp requirements
        ca-certificates \
        libapr1 \
        libmbedcrypto1 \
        libmbedtls10 \
        libmbedx509-0 \
        libnuma1 \
        python-cffi \
        python-enum34 \
 && rm -rf /var/lib/apt/lists/*

# Configure locales
RUN locale-gen en_US.UTF-8 \
 && dpkg-reconfigure locales

# Fix permissions
RUN chown root:syslog /var/log \
 && chmod 755 /etc/default

# Create directory structure
RUN mkdir -p /tmp/dumps \
 && mkdir -p /var/cache/vpp/python \
 && mkdir -p /var/run/sshd

# PIP pre-cache
RUN pip install \
        docopt==0.6.2 \
        ecdsa==0.13 \
        enum34==1.1.2 \
        ipaddress==1.0.16 \
        paramiko==1.16.0 \
        pexpect==4.6.0 \
        pycrypto==2.6.1 \
        pykwalify==1.5.0 \
        pypcap==1.1.5 \
        python-dateutil==2.4.2 \
        PyYAML==3.11 \
        requests==2.9.1 \
        robotframework==2.9.2 \
        scapy==2.3.1 \
        scp==0.10.2 \
        six==1.12.0 \
        dill==0.2.8.2 \
        numpy==1.14.5 \
        scipy==1.1.0

# SSH settings
RUN echo 'root:Csit1234' | chpasswd \
 && sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
 && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \
 && echo "export VISIBLE=now" >> /etc/profile

EXPOSE 22

COPY supervisord.conf /etc/supervisord/supervisord.conf

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"]