Add Dockerfile for building testing image

There are two images because it's hard to install both Python 2
and Python 3 packages (e.g. libcomps) in latest fedora release.

JIRA: RHELCMP-4580
Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
Haibo Lin 2021-03-15 16:33:06 +08:00
parent 535034ef91
commit edb4517e80
2 changed files with 47 additions and 0 deletions

22
tests/Dockerfile-test Normal file
View File

@ -0,0 +1,22 @@
FROM fedora:33
LABEL \
name="Pungi test" \
description="Run tests using tox with Python 3" \
vendor="Pungi developers" \
license="MIT"
RUN dnf -y update && dnf -y install \
findutils \
git \
koji \
make \
python3-createrepo_c \
python3-tox \
python3-urlgrabber \
&& dnf clean all
WORKDIR /src
COPY . .
CMD ["tox", "-e", "flake8,black,py3"]

25
tests/Dockerfile-test-py2 Normal file
View File

@ -0,0 +1,25 @@
FROM centos:7
LABEL \
name="Pungi test" \
description="Run tests using tox with Python 2" \
vendor="Pungi developers" \
license="MIT"
RUN yum -y update && yum -y install \
git \
make \
python3 \
python-gssapi \
python-libcomps \
python-createrepo_c \
pykickstart \
&& yum clean all
# python-tox in yum repo is too old, let's install latest version
RUN pip3 install tox
WORKDIR /src
COPY . .
CMD ["tox", "-e", "py27"]