Common Dockerfile for CVP-Sanity and CVP-SPT
Related-Task: #PROD-26312(PROD:26312)
Change-Id: I457a8d5c6ff73d944518f6b0c2c568f8286728a9
diff --git a/Dockerfile b/Dockerfile
index c6a1fe8..bb69afe 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,12 +9,12 @@
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
USER root
-RUN mkdir -p /var/lib/cvp-sanity/
-COPY cvp-sanity/ /var/lib/cvp-sanity
ARG UBUNTU_MIRROR_URL="http://archive.ubuntu.com/ubuntu"
WORKDIR /var/lib/
-
+COPY bin/ /usr/local/bin/
+COPY test_set/ ./
+#
RUN set -ex; pushd /etc/apt/ && echo > sources.list && \
echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages && \
echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes && \
@@ -23,15 +23,28 @@
echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-updates main restricted universe multiverse" >> sources.list && \
echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-backports main restricted universe multiverse" >> sources.list && \
popd ; apt-get update && apt-get upgrade -y && \
- apt-get install -y curl git-core iputils-ping libffi-dev libldap2-dev libsasl2-dev libssl-dev patch python-dev python-pip python3-dev vim-tiny wget \
+ apt-get install -y build-essential curl git-core iputils-ping libffi-dev libldap2-dev libsasl2-dev libssl-dev patch python-dev python-pip python3-dev vim-tiny wget \
python-virtualenv python3-virtualenv && \
-#Due to upstream bug we should use fixed version of pip
- python -m pip install --upgrade 'pip==9.0.3' && \
- pip install -r cvp-sanity/requirements.txt && \
+# Due to upstream bug we should use fixed version of pip
+ python -m pip install --upgrade 'pip==9.0.3' \
+ # initialize cvp sanity test suite
+ && pushd cvp_sanity \
+ && virtualenv venv \
+ && . venv/bin/activate \
+ && pip install -r requirements.txt \
+ && deactivate \
+ && popd \
+ # initialize cvp spt test suite
+ && pushd cvp_spt \
+ && virtualenv venv \
+ && . venv/bin/activate \
+ && pip install -r requirements.txt \
+ && deactivate \
+ && popd && \
# Cleanup
apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc && \
apt-get -y autoremove; apt-get -y clean ; rm -rf /root/.cache; rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* ; rm -rf /var/tmp/* ; rm -rfv /etc/apt/sources.list.d/* ; echo > /etc/apt/sources.list
-COPY bin /usr/local/bin/
-ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
-# docker build --no-cache -t cvp-sanity-checks:$(date "+%Y_%m_%d_%H_%M_%S") .
+
+ENTRYPOINT ["entrypoint.sh"]
+# docker build --no-cache -t cvp-sanity-checks:test_latest .