forked from rpm-software-management/ci-dnf-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.local
39 lines (35 loc) · 2.21 KB
/
Dockerfile.local
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
FROM fedora:24
ENV LANG C
COPY dnf-docker-test/repo /var/www/html/repo/
COPY dnf-docker-test/features /behave/
COPY rpms /rpms/
RUN echo $'\necho "deltarpm=0" >> /etc/dnf/dnf.conf' \
&& echo "deltarpm=0" >> /etc/dnf/dnf.conf \
# behave: core
# httpd: old-style repos
# six: py2/py3
# enum34: rpmdb State
# whichcraft: shutil.which() for py2
# jinja2: rpmspec template
&& echo $'\ndnf -y install dnf-plugins-core python3-dnf-plugins-core python2-dnf-plugins-core httpd python2-behave python2-six python-enum34 https://kojipkgs.fedoraproject.org//packages/python-whichcraft/0.4.0/2.fc24/noarch/python2-whichcraft-0.4.0-2.fc24.noarch.rpm python2-jinja2 rpm-build createrepo_c python2-pexpect' \
&& dnf -y install dnf-plugins-core python3-dnf-plugins-core python2-dnf-plugins-core httpd python2-behave python2-six python-enum34 python2-whichcraft python2-jinja2 rpm-build createrepo_c python2-pexpect \
# Allows to run test with rpms from only single component in rpms/
&& echo $'\ndnf -y copr enable rpmsoftwaremanagement/dnf-nightly' \
&& dnf -y copr enable rpmsoftwaremanagement/dnf-nightly \
# prevent installation of dnf-plugins-extras (versionlock, local, torproxy)
&& echo $'\nrm /rpms/*extras-versionlock*.rpm /rpms/*extras-local*.rpm /rpms/*extras-torproxy*.rpm || (>&2 echo "RPMs files do not exist")' \
&& rm /rpms/*extras-versionlock*.rpm /rpms/*extras-local*.rpm /rpms/*extras-torproxy*.rpm || (>&2 echo "RPMs files do not exist") \
&& echo $'\ndnf -y update' \
&& dnf -y update \
&& echo $'\nif ls /rpms/*.rpm 1> /dev/null 2>&1; then dnf -y install /rpms/*.rpm; else (>&2 echo "RPMs files do not exist"); fi' \
&& if ls /rpms/*.rpm 1> /dev/null 2>&1; then dnf -y install /rpms/*.rpm; else (>&2 echo "RPMs files do not exist"); fi \
&& echo $'\ndnf -y mark install $(dnf repoquery --unneeded -q)' \
&& dnf -y mark install $(dnf repoquery --unneeded -q) \
&& echo $'\ndnf -y clean all' \
&& dnf -y clean all \
&& echo $'\nmkdir /tmp/repos.d && mv /etc/yum.repos.d/* /tmp/repos.d/' \
&& mkdir /tmp/repos.d && mv /etc/yum.repos.d/* /tmp/repos.d/ \
&& echo $'\nmkdir /repo' \
&& mkdir /repo
ADD dnf-docker-test/launch-test /usr/bin/
VOLUME ["/junit"]