From edb4517e809e7b0f8c2f7e930a41c9633d515b0d Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Mon, 15 Mar 2021 16:33:06 +0800 Subject: [PATCH] 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 --- tests/Dockerfile-test | 22 ++++++++++++++++++++++ tests/Dockerfile-test-py2 | 25 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tests/Dockerfile-test create mode 100644 tests/Dockerfile-test-py2 diff --git a/tests/Dockerfile-test b/tests/Dockerfile-test new file mode 100644 index 00000000..43b4191d --- /dev/null +++ b/tests/Dockerfile-test @@ -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"] diff --git a/tests/Dockerfile-test-py2 b/tests/Dockerfile-test-py2 new file mode 100644 index 00000000..1e41be20 --- /dev/null +++ b/tests/Dockerfile-test-py2 @@ -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"]