Oleksii Molchanov | 9c3ba2e | 2021-03-22 22:33:31 +0200 | [diff] [blame] | 1 | FROM ubuntu:20.04 |
Oleksii Zhurba | 4ccdbf2 | 2018-09-04 21:00:19 -0500 | [diff] [blame] | 2 | |
azvyagintsev | ec38a1c | 2018-12-18 16:10:14 +0200 | [diff] [blame] | 3 | LABEL maintainer="dev@mirantis.com" |
Oleksii Molchanov | 9c3ba2e | 2021-03-22 22:33:31 +0200 | [diff] [blame] | 4 | LABEL build_date="2021-03-23" |
azvyagintsev | ec38a1c | 2018-12-18 16:10:14 +0200 | [diff] [blame] | 5 | |
| 6 | ENV DEBIAN_FRONTEND=noninteractive \ |
| 7 | DEBCONF_NONINTERACTIVE_SEEN=true \ |
| 8 | LANG=C.UTF-8 \ |
Hanna Arhipova | 759e39c | 2019-05-28 12:38:24 +0300 | [diff] [blame] | 9 | LANGUAGE=$LANG \ |
| 10 | PYTEST_REPORT_DIR=/var/lib/validation_artifacts |
azvyagintsev | e67f735 | 2018-12-20 16:11:40 +0200 | [diff] [blame] | 11 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
azvyagintsev | ec38a1c | 2018-12-18 16:10:14 +0200 | [diff] [blame] | 12 | |
Oleksii Zhurba | 4ccdbf2 | 2018-09-04 21:00:19 -0500 | [diff] [blame] | 13 | USER root |
azvyagintsev | e67f735 | 2018-12-20 16:11:40 +0200 | [diff] [blame] | 14 | ARG UBUNTU_MIRROR_URL="http://archive.ubuntu.com/ubuntu" |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 15 | ARG SL_TEST_REPO='http://gerrit.mcp.mirantis.com/mcp/stacklight-pytest' |
| 16 | ARG SL_TEST_BRANCH='master' |
Hanna Arhipova | 91dc815 | 2019-07-04 12:43:16 +0300 | [diff] [blame] | 17 | ENV PYTHONHTTPSVERIFY=0 |
Oleksii Zhurba | 4ccdbf2 | 2018-09-04 21:00:19 -0500 | [diff] [blame] | 18 | |
| 19 | WORKDIR /var/lib/ |
Hanna Arhipova | 55cc129 | 2019-01-08 14:22:18 +0200 | [diff] [blame] | 20 | COPY bin/ /usr/local/bin/ |
| 21 | COPY test_set/ ./ |
Oleksii Molchanov | 9c3ba2e | 2021-03-22 22:33:31 +0200 | [diff] [blame] | 22 | |
Hanna Arhipova | 1f3bb7c | 2020-02-10 17:06:00 +0200 | [diff] [blame] | 23 | RUN set -exo pipefail; pushd /etc/apt/ && echo > sources.list && \ |
azvyagintsev | e67f735 | 2018-12-20 16:11:40 +0200 | [diff] [blame] | 24 | echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages && \ |
| 25 | echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes && \ |
| 26 | echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends && \ |
Oleksii Molchanov | 9c3ba2e | 2021-03-22 22:33:31 +0200 | [diff] [blame] | 27 | echo "deb [arch=amd64] $UBUNTU_MIRROR_URL focal main restricted universe multiverse" >> sources.list && \ |
| 28 | echo "deb [arch=amd64] $UBUNTU_MIRROR_URL focal-updates main restricted universe multiverse" >> sources.list && \ |
| 29 | echo "deb [arch=amd64] $UBUNTU_MIRROR_URL focal-backports main restricted universe multiverse" >> sources.list && \ |
azvyagintsev | e67f735 | 2018-12-20 16:11:40 +0200 | [diff] [blame] | 30 | popd ; apt-get update && apt-get upgrade -y && \ |
Oleksii Molchanov | 9c3ba2e | 2021-03-22 22:33:31 +0200 | [diff] [blame] | 31 | apt-get install -y build-essential curl git-core iputils-ping libffi-dev libldap2-dev libsasl2-dev libssl-dev patch vim-tiny wget \ |
| 32 | virtualenv python2.7 python2.7-dev python3.8 python3.8-dev python3-pip \ |
Hanna Arhipova | 55cc129 | 2019-01-08 14:22:18 +0200 | [diff] [blame] | 33 | # Due to upstream bug we should use fixed version of pip |
Oleksii Molchanov | 9c3ba2e | 2021-03-22 22:33:31 +0200 | [diff] [blame] | 34 | && pip3 install -U pip==20.0.2 \ |
| 35 | && pip3 install tox \ |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 36 | # initialize cvp stacklight test suite |
Hanna Arhipova | 1f3bb7c | 2020-02-10 17:06:00 +0200 | [diff] [blame] | 37 | && mkdir cvp-stacklight \ |
| 38 | && pushd cvp-stacklight \ |
| 39 | && git clone -b $SL_TEST_BRANCH $SL_TEST_REPO \ |
| 40 | && pushd stacklight-pytest \ |
| 41 | && git log -n1 \ |
| 42 | && popd && popd \ |
| 43 | && tox --recreate \ |
azvyagintsev | ec38a1c | 2018-12-18 16:10:14 +0200 | [diff] [blame] | 44 | # Cleanup |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 45 | && apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc && \ |
azvyagintsev | e67f735 | 2018-12-20 16:11:40 +0200 | [diff] [blame] | 46 | apt-get -y autoremove; apt-get -y clean ; rm -rf /root/.cache; rm -rf /var/lib/apt/lists/* && \ |
Ievgeniia Zadorozhna | 5526134 | 2019-11-11 16:26:28 +0300 | [diff] [blame] | 47 | rm -rf /tmp/* ; rm -rf /var/tmp/* ; rm -rfv /etc/apt/sources.list.d/* ; echo > /etc/apt/sources.list \ |
Ievgeniia Zadorozhna | 5526134 | 2019-11-11 16:26:28 +0300 | [diff] [blame] | 48 | # Download iperf package |
| 49 | && wget http://ftp.br.debian.org/debian/pool/main/i/iperf/iperf_2.0.5+dfsg1-2_amd64.deb -O /var/lib/iperf_2.0.5+dfsg1-2_amd64.deb |
Hanna Arhipova | 55cc129 | 2019-01-08 14:22:18 +0200 | [diff] [blame] | 50 | |
| 51 | ENTRYPOINT ["entrypoint.sh"] |
| 52 | # docker build --no-cache -t cvp-sanity-checks:test_latest . |