forked from rpm-software-management/ci-dnf-stack
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.centos7
117 lines (97 loc) · 2.96 KB
/
Dockerfile.centos7
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Build
# -----
# $ podman build --build-arg TYPE=local -t dnf-bot/ci-dnf-stack:centos7 -f Dockerfile.centos7
#
#
# Run
# ---
# $ podman run -it dnf-bot/ci-dnf-stack:centos7 behave -Ddnf_executable=dnf --junit --junit-directory=/opt/behave/junit/ [--wip --no-skipped]
#
#
# Build types
# -----------
# distro
# install distro packages
# copr
# install distro packages
# then upgrade to copr packages
# local
# install distro packages
# then upgrade to copr packages
# then install packages from local rpms/ folder
# install also additional tools for debugging in the container
FROM centos:7
ENV LANG C
ARG TYPE=local
ARG OSVERSION=centos__7
# disable deltas and weak deps
RUN set -x && \
echo -e "deltarpm=0" >> /etc/yum.conf && \
echo -e "install_weak_deps=0" >> /etc/yum.conf
# install EPEL repo
RUN set -x && \
rpm -Uvh http://download.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
# if TYPE == copr or local, enable nightly copr
RUN set -x && \
if [ "$TYPE" == "copr" -o "$TYPE" == "local" ]; then \
yum -y install yum-plugin-copr; \
yum -y copr enable rpmsoftwaremanagement/dnf-nightly; \
fi
# upgrade all packages to the latest available versions
RUN set -x && \
yum -y upgrade
# remove yum-utils, they conflict with dnf-utils
RUN set -x && \
yum -y remove yum-utils
# install the test environment and additional packages
RUN set -x && \
yum -y install \
# behave and test requirements
libfaketime \
# python2-behave - version >= 1.2.6 is not available as an RPM; install it from pip instead
python2-pip \
pexpect \
# if TYPE == local, install debugging tools
$(if [ "$TYPE" == "local" ]; then \
echo \
less \
openssh-clients \
procps-ng \
psmisc \
screen \
strace \
tcpdump \
vim-enhanced \
vim-minimal \
wget \
; \
fi) \
# install dnf stack
createrepo_c \
dnf \
dnf-plugins-core \
# dnf-utils are disabled in the latest builds
# dnf-utils \
libdnf \
microdnf && \
pip install 'behave >= 1.2.6'
# if TYPE == local, install local RPMs
COPY ./rpms/ /opt/behave/rpms/
RUN if [ "$TYPE" == "local" -a -n "$(find /opt/behave/rpms/ -maxdepth 1 -name '*.rpm' -print -quit)" ]; then \
dnf -y install /opt/behave/rpms/*.rpm \
-x '*-debuginfo' \
-x '*-debugsource' \
-x '*plugin-versionlock*' \
-x '*plugin-local*' \
-x '*plugin-torproxy*' \
-x '*plugin-migrate*' \
; \
fi
# copy test suite
COPY ./dnf-behave-tests/ /opt/behave/
# set os userdata for behave
RUN echo -e "\
[behave.userdata]\n\
os=$OSVERSION" > /opt/behave/behave.ini
VOLUME ["/opt/behave/junit"]
WORKDIR /opt/behave