blob: 3a8e5cd593f8cf47aac5840a9c40f81a9388a6b5 [file] [log] [blame]
Oleksii Zhurba4ccdbf22018-09-04 21:00:19 -05001FROM ubuntu:16.04
2
azvyagintsevec38a1c2018-12-18 16:10:14 +02003LABEL maintainer="dev@mirantis.com"
4
5ENV DEBIAN_FRONTEND=noninteractive \
6 DEBCONF_NONINTERACTIVE_SEEN=true \
7 LANG=C.UTF-8 \
8 LANGUAGE=$LANG
azvyagintseve67f7352018-12-20 16:11:40 +02009SHELL ["/bin/bash", "-o", "pipefail", "-c"]
azvyagintsevec38a1c2018-12-18 16:10:14 +020010
Oleksii Zhurba4ccdbf22018-09-04 21:00:19 -050011USER root
azvyagintseve67f7352018-12-20 16:11:40 +020012ARG UBUNTU_MIRROR_URL="http://archive.ubuntu.com/ubuntu"
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030013ARG SL_TEST_REPO='http://gerrit.mcp.mirantis.com/mcp/stacklight-pytest'
Hanna Arhipovafdc75422019-05-27 19:26:23 +030014ARG SL_TEST_BRANCH='release/2019.2.0'
Oleksii Zhurba4ccdbf22018-09-04 21:00:19 -050015
16WORKDIR /var/lib/
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030017COPY bin/ /usr/local/bin/
18COPY test_set/ ./
19#
azvyagintseve67f7352018-12-20 16:11:40 +020020RUN set -ex; pushd /etc/apt/ && echo > sources.list && \
21 echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages && \
22 echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes && \
23 echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends && \
24 echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial main restricted universe multiverse" >> sources.list && \
25 echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-updates main restricted universe multiverse" >> sources.list && \
26 echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-backports main restricted universe multiverse" >> sources.list && \
27 popd ; apt-get update && apt-get upgrade -y && \
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030028 apt-get install -y build-essential curl git-core iputils-ping libffi-dev libldap2-dev libsasl2-dev libssl-dev patch python-dev python-pip vim-tiny wget \
29 python-virtualenv \
30# Enable these packages while porting to Python3 => python3-virtualenv python3-dev \
31# Due to upstream bug we should use fixed version of pip
32 && python -m pip install --upgrade 'pip==9.0.3' \
33 # initialize cvp sanity test suite
34 && pushd cvp-sanity \
35 && virtualenv --python=python2 venv \
36 && . venv/bin/activate \
37 && pip install -r requirements.txt \
38 && deactivate \
39 && popd \
40 # initialize cvp spt test suite
41 && pushd cvp-spt \
42 && virtualenv --python=python2 venv \
43 && . venv/bin/activate \
44 && pip install -r requirements.txt \
45 && deactivate \
46 && popd \
47 # initialize cvp stacklight test suite
48 && mkdir cvp-stacklight \
49 && pushd cvp-stacklight \
50 && virtualenv --system-site-packages venv \
51 && . venv/bin/activate \
52 && git clone -b $SL_TEST_BRANCH $SL_TEST_REPO \
53 && pip install ./stacklight-pytest \
54 && pip install -r stacklight-pytest/requirements.txt \
55 && deactivate \
56 && popd \
azvyagintsevec38a1c2018-12-18 16:10:14 +020057# Cleanup
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030058 && apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc && \
azvyagintseve67f7352018-12-20 16:11:40 +020059 apt-get -y autoremove; apt-get -y clean ; rm -rf /root/.cache; rm -rf /var/lib/apt/lists/* && \
60 rm -rf /tmp/* ; rm -rf /var/tmp/* ; rm -rfv /etc/apt/sources.list.d/* ; echo > /etc/apt/sources.list
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030061
62ENTRYPOINT ["entrypoint.sh"]
63# docker build --no-cache -t cvp-sanity-checks:test_latest .