Updated dockerfile for ubuntu container building
Related-PROD: PROD-36128
Change-Id: I6335851a1292f9856ce3ce78d65025fa0e1e7120
diff --git a/k8s/docker-ubuntu-2004 b/k8s/docker-ubuntu-2004
index 774e6f4..cb5d35a 100644
--- a/k8s/docker-ubuntu-2004
+++ b/k8s/docker-ubuntu-2004
@@ -2,34 +2,42 @@
MAINTAINER Alex Savatieiev (a.savex@gmail.com)
-WORKDIR /tmp
+ADD ./si-tests.tgz /opt/si-tests/
+WORKDIR /opt
RUN apt-get update && \
apt-get install -y make gcc g++ git libaio-dev libaio1 zlib1g-dev && \
git clone --depth 1 --branch fio-3.26 https://github.com/axboe/fio.git && \
- cd /tmp/fio && \
+ cd /opt/fio && \
./configure && \
make && \
make install && \
- cd /tmp && \
- rm -rf /tmp/fio
-WORKDIR /opt
-RUN apt-get update && \
+ cd /opt && \
+ rm -rf /opt/fio && \
export TZ="America/Chicago" && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
- apt-get install -y python3-pip vim git iperf3 mtr htop iputils-ping traceroute tcpdump wget iproute2 curl && \
- pip3 install python-openstackclient python-neutronclient python-heatclient pyghmi python-octaviaclient && \
+ apt-get install -y python3-pip python3-venv vim git iperf3 mtr htop iputils-ping traceroute tcpdump wget iproute2 curl && \
+ pip3 install --no-cache-dir python-openstackclient python-neutronclient python-heatclient pyghmi python-octaviaclient && \
git clone https://gerrit.mcp.mirantis.com/mcp/cvp-configuration /opt/res-files && \
+ git clone http://gerrit.mcp.mirantis.com/mcp/cfg-checker /opt/cfg-checker && \
+ cd /opt/cfg-checker && \
+ python3 -m venv .checkervenv && \
+ . .checkervenv/bin/activate && \
+ pip3 install --no-cache-dir -r requirements.txt && \
+ python3 setup.py develop && \
+ deactivate && \
mkdir /opt/cmp-check && cd /opt/cmp-check && \
cp /opt/res-files/scripts/prepare.sh ./ && \
cp /opt/res-files/scripts/cmp_check.sh ./ && \
- cp /opt/res-files/cleanup.sh ./
-
-ADD ./si-tests.tgz /opt/si-tests/
-RUN apt -y install python3-venv && \
+ cp /opt/res-files/cleanup.sh ./ && \
cd /opt/si-tests/ && \
python3 -m venv .venv && \
. .venv/bin/activate && \
- pip3 install -r si_tests/requirements.txt
+ pip3 install --no-cache-dir -r si_tests/requirements.txt && \
+ apt -y remove git make g++ gcc && \
+ apt -y autoremove --purge && \
+ rm -rf /var/lib/apt/lists/* && \
+ rm -rf /opt/res-files/.git && \
+ rm -rf /opt/cfg-checker/.git
ENTRYPOINT ["sleep infinite"]