This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
forked from openshift/assisted-test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.assisted-test-infra
76 lines (62 loc) · 3.05 KB
/
Dockerfile.assisted-test-infra
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM quay.io/edge-infrastructure/assisted-service:latest AS service
FROM quay.io/assisted-installer-ops/base-python:3.11.0
# A directory in the path with write permission even for non-root users
ENV TOOLS=/tools/
ENV PATH="$TOOLS:$PATH"
RUN mkdir $TOOLS --mode g+xw
# TODO: Remove once OpenShift CI supports it out of the box (see https://access.redhat.com/articles/4859371)
RUN chmod g+w /etc/passwd && \
echo 'echo default:x:$(id -u):$(id -g):Default Application User:/alabama:/sbin/nologin\ >> /etc/passwd' > /usr/local/bin/fix_uid.sh && \
chmod g+rwx /usr/local/bin/fix_uid.sh
# tune dnf to download more packages in parallel and from the closest mirror
RUN echo "fastestmirror=1" >> /etc/dnf/dnf.conf && \
echo "max_parallel_downloads=10" >> /etc/dnf/dnf.conf
# CRB repo is required for libvirt-devel
RUN dnf -y install --enablerepo=crb \
make \
gcc \
unzip \
curl-minimal \
git \
httpd-tools \
jq \
nss_wrapper \
libvirt-client \
guestfs-tools \
libvirt-devel \
libguestfs-tools \
libxslt \
xorriso \
&& dnf clean all
# Git checks if the user that owns the files on the filesystem match the
# current user. We need to disable this check because tests in Prow are
# running with a random user.
RUN git config --system --add safe.directory '*'
RUN curl --retry 5 -Lo packer.zip https://releases.hashicorp.com/packer/1.8.0/packer_1.8.0_linux_386.zip && unzip packer.zip -d /usr/bin/ && mv /usr/bin/packer /usr/bin/packer.io && rm -rf packer.zip
RUN curl --retry 5 -Lo terraform.zip https://releases.hashicorp.com/terraform/1.3.6/terraform_1.3.6_linux_amd64.zip && unzip terraform.zip -d /usr/bin/ && rm -rf terraform.zip
RUN curl --retry 5 -L https://github.com/containers/podman/releases/download/v3.4.4/podman-remote-static.tar.gz -o "/tmp/podman-remote3.tar.gz" && \
tar -zxvf /tmp/podman-remote3.tar.gz && \
mv podman-remote-static /tools/podman-remote3 && \
rm -f /tmp/podman-remote3.tar.gz &&\
curl --retry 5 -L https://github.com/containers/podman/releases/download/v4.1.1/podman-remote-static.tar.gz -o "/tmp/podman-remote4.tar.gz" && \
tar -zxvf /tmp/podman-remote4.tar.gz && \
mv podman-remote-static /tools/podman-remote4 && \
rm -f /tmp/podman-remote4.tar.gz
COPY --from=quay.io/ocp-splat/govc:v0.29.0 /govc /usr/local/bin
WORKDIR /home/assisted-test-infra
COPY requirements.txt requirements-dev.txt ./
COPY --from=service /clients/assisted_service_client-*.whl /build/pip/
RUN pip3 install --upgrade pip && \
pip3 install --no-cache-dir -I -r ./requirements.txt -r ./requirements-dev.txt && \
pip3 install --upgrade /build/pip/*
RUN curl --retry 5 -s https://storage.googleapis.com/golang/go1.18.1.linux-amd64.tar.gz | tar -C /usr/local -xz
ENV GOPATH=/go
ENV GOCACHE=/go/.cache
ENV PATH=$PATH:/usr/local/go/bin:/go/bin
COPY . .
# init terraform in order to cache the provider
RUN terraform -chdir=/home/assisted-test-infra/terraform_files/equinix-ci-machine init && \
chgrp -R 0 /home/assisted-test-infra && \
chmod -R g=u /home/assisted-test-infra
# setting pre-commit env
ENV PRE_COMMIT_HOME build