Files
fm-orchestrator/Dockerfile-tests
2018-04-05 13:07:13 -04:00

54 lines
1.6 KiB
Plaintext

FROM centos:7
WORKDIR /build
RUN yum -y update
RUN yum -y install epel-release yum-utils
RUN yum-config-manager --add-repo https://kojipkgs.fedoraproject.org/repos-dist/epel7Server-infra/latest/x86_64/
RUN yum -y install \
--nogpgcheck \
--setopt=deltarpm=0 \
--setopt=install_weak_deps=false \
--setopt=tsflags=nodocs \
createrepo_c \
fedmsg \
fedmsg-hub \
git \
kobo \
kobo-rpmlib \
libmodulemd \
pdc-client \
python-backports-ssl_match_hostname \
python-dogpile-cache \
python-enum34 \
python-flask \
python-flask-migrate \
python-flask-sqlalchemy \
python-funcsigs \
python-futures \
python-koji \
python-ldap3 \
python-mock \
python-pip \
python-requests \
python-six \
python-solv \
python-sqlalchemy \
# Test-only dependencies
python-flake8 \
python-mock \
python-tox \
rpm-build \
&& yum clean all
# We currently require a newer versions of these Python packages for the tests
RUN pip install --upgrade flask-sqlalchemy pytest flake8
# TODO: Consider making this a volume instead
COPY . .
# We install the python-koji RPM but it doesn't register as installed through pip.
# This hacks keeps tox from install koji from PyPi.
RUN sed -i '/koji/d' requirements.txt
# Delete any leftover compiled Python files
RUN find . -type f \( -name '*.pyc' -or -name '*.pyc' -or -name '__pycache__' \) -exec rm -rf {} \;
# Since tox seems to ignore `usedevelop` when we have `sitepackages` on, we have to run it manually
RUN python setup.py develop
CMD ["/usr/bin/tox", "-e", "flake8,py27"]