beef up the AI/ML framework tests by adding InfluxDB as data source and populate...
[it/test.git] / XTesting / kubespray / Dockerfile
1 # Use imutable image tags rather than mutable tags (like ubuntu:20.04)
2 FROM ubuntu:focal-20220531
3
4 ARG ARCH=amd64
5 ARG TZ=Etc/UTC
6 RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
7
8 RUN apt update -y \
9     && apt install -y \
10     libssl-dev python3-dev sshpass apt-transport-https jq moreutils \
11     ca-certificates curl gnupg2 software-properties-common python3-pip unzip rsync git \
12     && rm -rf /var/lib/apt/lists/*
13 RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
14     && add-apt-repository \
15     "deb [arch=$ARCH] https://download.docker.com/linux/ubuntu \
16     $(lsb_release -cs) \
17     stable" \
18     && apt update -y && apt-get install --no-install-recommends -y docker-ce \
19     && rm -rf /var/lib/apt/lists/*
20
21 # Some tools like yamllint need this
22 # Pip needs this as well at the moment to install ansible
23 # (and potentially other packages)
24 # See: https://github.com/pypa/pip/issues/10219
25 ENV LANG=C.UTF-8
26
27 WORKDIR /kubespray
28 COPY . .
29 RUN /usr/bin/python3 -m pip install --no-cache-dir pip -U \
30     && /usr/bin/python3 -m pip install --no-cache-dir -r tests/requirements.txt \
31     && python3 -m pip install --no-cache-dir -r requirements.txt \
32     && update-alternatives --install /usr/bin/python python /usr/bin/python3 1
33
34 RUN KUBE_VERSION=$(sed -n 's/^kube_version: //p' roles/kubespray-defaults/defaults/main.yaml) \
35     && curl -LO https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/$ARCH/kubectl \
36     && chmod a+x kubectl \
37     && mv kubectl /usr/local/bin/kubectl
38
39 RUN chmod a+x scripts/deploy.sh
40
41 CMD scripts/deploy.sh