forked from mmornati/docker-mock-rpmbuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (24 loc) · 984 Bytes
/
Dockerfile
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
FROM centos:centos7.6.1810
LABEL "maintainer"="Marco Mornati <[email protected]>"
LABEL "com.github.actions.name"="RPM Builder"
LABEL "com.github.actions.description"="Build RPM using RedHat Mock"
LABEL "com.github.actions.icon"="pocket"
LABEL "com.github.actions.color"="green"
RUN yum -y --setopt="tsflags=nodocs" update && \
yum -y --setopt="tsflags=nodocs" install epel-release mock rpm-sign expect && \
yum clean all && \
rm -rf /var/cache/yum/
#Configure users
RUN useradd -u 1000 -G mock builder && \
chmod g+w /etc/mock/*.cfg
VOLUME ["/rpmbuild"]
ONBUILD COPY mock /etc/mock
# create mock cache on external volume to speed up build
RUN install -g mock -m 2775 -d /rpmbuild/cache/mock
RUN echo "config_opts['cache_topdir'] = '/rpmbuild/cache/mock'" >> /etc/mock/site-defaults.cfg
ADD ./build-rpm.sh /build-rpm.sh
RUN chmod +x /build-rpm.sh
#RUN setcap cap_sys_admin+ep /usr/sbin/mock
ADD ./rpm-sign.exp /rpm-sign.exp
RUN chmod +x /rpm-sign.exp
CMD ["/build-rpm.sh"]