2021-04-12 23:28:06 +09:00
|
|
|
# Dockerfile for build RPM packages.
|
2022-05-31 17:46:06 +09:00
|
|
|
# Copyright (C) 2021 - 2022 Teddysun <i@teddysun.com>
|
2021-04-12 23:28:06 +09:00
|
|
|
|
2024-12-29 23:22:33 +09:00
|
|
|
FROM centos:7
|
2021-04-12 23:28:06 +09:00
|
|
|
LABEL maintainer="Teddysun <i@teddysun.com>"
|
|
|
|
|
|
|
|
RUN yum install -y yum-utils epel-release centos-release-scl-rh && \
|
|
|
|
yum-config-manager --enable epel && \
|
|
|
|
yum install -y tar wget git tree gcc gcc-c++ \
|
2022-05-31 17:46:06 +09:00
|
|
|
sudo net-tools make cmake zstd libzstd chkconfig \
|
2021-11-03 11:15:15 +09:00
|
|
|
python bash coreutils diffutils patch ca-certificates \
|
2022-11-25 12:46:42 +09:00
|
|
|
rpm-build rpm-devel rpmlint rpmdevtools which procps \
|
2021-04-12 23:28:06 +09:00
|
|
|
devtoolset-9-gcc devtoolset-9-binutils devtoolset-9-runtime \
|
|
|
|
scl-utils asciidoc bison elfutils-libelf-devel m4 newt-devel \
|
|
|
|
openssl-devel openssl xmlto audit-libs-devel binutils-devel elfutils-devel \
|
|
|
|
gettext java-1.8.0-openjdk-devel libcap-devel numactl-devel python-devel python3 \
|
2021-10-09 13:51:13 +09:00
|
|
|
slang-devel xz-devel zlib-devel ncurses-devel pciutils-devel perl-ExtUtils-Embed epel-rpm-macros && \
|
2021-04-12 23:28:06 +09:00
|
|
|
yum clean all && rm -rf /var/cache/yum /var/lib/rpm/__db*
|
|
|
|
|
|
|
|
RUN useradd builder -u 1000 -m -G users,wheel && \
|
|
|
|
echo "builder ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers && \
|
|
|
|
echo "# macros" > /home/builder/.rpmmacros && \
|
|
|
|
echo "%_topdir /home/builder/rpmbuild" >> /home/builder/.rpmmacros && \
|
|
|
|
echo "%_sourcedir %{_topdir}" >> /home/builder/.rpmmacros && \
|
|
|
|
echo "%_builddir %{_topdir}" >> /home/builder/.rpmmacros && \
|
|
|
|
echo "%_specdir %{_topdir}" >> /home/builder/.rpmmacros && \
|
|
|
|
echo "%_rpmdir %{_topdir}" >> /home/builder/.rpmmacros && \
|
|
|
|
echo "%_srcrpmdir %{_topdir}" >> /home/builder/.rpmmacros && \
|
|
|
|
mkdir -p /home/builder/rpmbuild && \
|
|
|
|
chown -R builder /home/builder
|
|
|
|
|
|
|
|
USER builder
|
|
|
|
VOLUME /home/builder
|
|
|
|
WORKDIR /home/builder/rpmbuild
|
|
|
|
CMD ["/bin/bash"]
|