-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild-rpm-Dockerfile
30 lines (24 loc) · 1.1 KB
/
build-rpm-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
FROM centos:8
ARG raintale_version
# RPM build dependencies -- thanks: https://www.redhat.com/sysadmin/create-rpm-package
RUN dnf update -y
RUN dnf install -y rpmdevtools rpmlint glibc-langpack-en
# MementoEmbed build/install dependencies
RUN dnf install -y epel-release
RUN dnf install -y sed grep tar python3-virtualenv makeself which make
# install Python3.8 separately and set it as the default
RUN dnf install -y python38
RUN alternatives --install /usr/bin/python unversioned-python /usr/bin/python3.8 1
# build the RPM
WORKDIR /root
RUN rpmdev-setuptree
RUN printf "#!/bin/bash\nrpmbuild -bs /root/rpmbuild/SPECS/raintale.spec\nrpmbuild -bb /root/rpmbuild/SPECS/raintale.spec\n" > /root/build-rpms.sh
RUN chmod 0700 ./build-rpms.sh
COPY source-distro/raintale-${raintale_version}.tar.gz ./rpmbuild/SOURCES
COPY raintale.spec .
RUN sed "s/{{ raintale_version }}/${raintale_version}/g" ./raintale.spec > /root/rpmbuild/SPECS/raintale.spec
RUN ls -l ./rpmbuild/SPECS/
RUN rpmlint ./rpmbuild/SPECS/raintale.spec
# keep running -- for debugging
# ENTRYPOINT [ "tail", "-f", "/dev/null"]
CMD ["/root/build-rpms.sh"]