Oleksii Zhurba | 4ccdbf2 | 2018-09-04 21:00:19 -0500 | [diff] [blame] | 1 | FROM ubuntu:16.04 |
| 2 | |
azvyagintsev | ec38a1c | 2018-12-18 16:10:14 +0200 | [diff] [blame] | 3 | LABEL maintainer="dev@mirantis.com" |
| 4 | |
| 5 | ENV DEBIAN_FRONTEND=noninteractive \ |
| 6 | DEBCONF_NONINTERACTIVE_SEEN=true \ |
| 7 | LANG=C.UTF-8 \ |
Hanna Arhipova | 759e39c | 2019-05-28 12:38:24 +0300 | [diff] [blame] | 8 | LANGUAGE=$LANG \ |
| 9 | PYTEST_REPORT_DIR=/var/lib/validation_artifacts |
azvyagintsev | e67f735 | 2018-12-20 16:11:40 +0200 | [diff] [blame] | 10 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
azvyagintsev | ec38a1c | 2018-12-18 16:10:14 +0200 | [diff] [blame] | 11 | |
Oleksii Zhurba | 4ccdbf2 | 2018-09-04 21:00:19 -0500 | [diff] [blame] | 12 | USER root |
azvyagintsev | e67f735 | 2018-12-20 16:11:40 +0200 | [diff] [blame] | 13 | ARG UBUNTU_MIRROR_URL="http://archive.ubuntu.com/ubuntu" |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 14 | ARG SL_TEST_REPO='http://gerrit.mcp.mirantis.com/mcp/stacklight-pytest' |
| 15 | ARG SL_TEST_BRANCH='master' |
Hanna Arhipova | 91dc815 | 2019-07-04 12:43:16 +0300 | [diff] [blame^] | 16 | ENV PYTHONHTTPSVERIFY=0 |
Oleksii Zhurba | 4ccdbf2 | 2018-09-04 21:00:19 -0500 | [diff] [blame] | 17 | |
| 18 | WORKDIR /var/lib/ |
Hanna Arhipova | 55cc129 | 2019-01-08 14:22:18 +0200 | [diff] [blame] | 19 | COPY bin/ /usr/local/bin/ |
| 20 | COPY test_set/ ./ |
| 21 | # |
azvyagintsev | e67f735 | 2018-12-20 16:11:40 +0200 | [diff] [blame] | 22 | RUN set -ex; pushd /etc/apt/ && echo > sources.list && \ |
| 23 | echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages && \ |
| 24 | echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes && \ |
| 25 | echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends && \ |
| 26 | echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial main restricted universe multiverse" >> sources.list && \ |
| 27 | echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-updates main restricted universe multiverse" >> sources.list && \ |
| 28 | echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-backports main restricted universe multiverse" >> sources.list && \ |
| 29 | popd ; apt-get update && apt-get upgrade -y && \ |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 30 | 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 \ |
| 31 | python-virtualenv \ |
| 32 | # Enable these packages while porting to Python3 => python3-virtualenv python3-dev \ |
Hanna Arhipova | 55cc129 | 2019-01-08 14:22:18 +0200 | [diff] [blame] | 33 | # Due to upstream bug we should use fixed version of pip |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 34 | && python -m pip install --upgrade 'pip==9.0.3' \ |
Hanna Arhipova | 55cc129 | 2019-01-08 14:22:18 +0200 | [diff] [blame] | 35 | # initialize cvp sanity test suite |
Hanna Arhipova | 16e93fb | 2019-01-23 19:03:01 +0200 | [diff] [blame] | 36 | && pushd cvp-sanity \ |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 37 | && virtualenv --python=python2 venv \ |
Hanna Arhipova | 55cc129 | 2019-01-08 14:22:18 +0200 | [diff] [blame] | 38 | && . venv/bin/activate \ |
| 39 | && pip install -r requirements.txt \ |
| 40 | && deactivate \ |
| 41 | && popd \ |
| 42 | # initialize cvp spt test suite |
Hanna Arhipova | 16e93fb | 2019-01-23 19:03:01 +0200 | [diff] [blame] | 43 | && pushd cvp-spt \ |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 44 | && virtualenv --python=python2 venv \ |
Hanna Arhipova | 55cc129 | 2019-01-08 14:22:18 +0200 | [diff] [blame] | 45 | && . venv/bin/activate \ |
| 46 | && pip install -r requirements.txt \ |
| 47 | && deactivate \ |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 48 | && popd \ |
| 49 | # initialize cvp stacklight test suite |
| 50 | && mkdir cvp-stacklight \ |
| 51 | && pushd cvp-stacklight \ |
| 52 | && virtualenv --system-site-packages venv \ |
| 53 | && . venv/bin/activate \ |
| 54 | && git clone -b $SL_TEST_BRANCH $SL_TEST_REPO \ |
Hanna Arhipova | 394f6bc | 2019-05-31 16:55:56 +0300 | [diff] [blame] | 55 | && pushd stacklight-pytest \ |
| 56 | && git log -n1 \ |
| 57 | && pip install . \ |
| 58 | && pip install -r requirements.txt \ |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 59 | && deactivate \ |
Hanna Arhipova | 394f6bc | 2019-05-31 16:55:56 +0300 | [diff] [blame] | 60 | && popd && popd \ |
azvyagintsev | ec38a1c | 2018-12-18 16:10:14 +0200 | [diff] [blame] | 61 | # Cleanup |
Hanna Arhipova | f9a95ca | 2019-01-30 15:47:00 +0200 | [diff] [blame] | 62 | && 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] | 63 | apt-get -y autoremove; apt-get -y clean ; rm -rf /root/.cache; rm -rf /var/lib/apt/lists/* && \ |
| 64 | rm -rf /tmp/* ; rm -rf /var/tmp/* ; rm -rfv /etc/apt/sources.list.d/* ; echo > /etc/apt/sources.list |
Hanna Arhipova | 55cc129 | 2019-01-08 14:22:18 +0200 | [diff] [blame] | 65 | |
| 66 | ENTRYPOINT ["entrypoint.sh"] |
| 67 | # docker build --no-cache -t cvp-sanity-checks:test_latest . |