From 800287d5ffc53bffedf0d193d9020de04d181574 Mon Sep 17 00:00:00 2001 From: Pham Tama Date: Sun, 11 Feb 2024 12:41:20 +0700 Subject: [PATCH] add automatic dependency install --- Dockerfile | 6 +++--- entrypoint.sh | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index bcf5bb4..ce5da69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM centos:7 +FROM centos:8 -RUN yum groupinstall -y "Development Tools" && \ - yum install -y \ +RUN dnf groupinstall -y "Development Tools" && \ + dnf install -y \ kernel-devel \ kernel-headers diff --git a/entrypoint.sh b/entrypoint.sh index ab48e1c..a1d3d52 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -26,7 +26,9 @@ fi readonly RPMBUILD_DIR="$HOME/rpmbuild" readonly RPMBUILD_SOURCE_DIR="$RPMBUILD_DIR/SOURCES" readonly RPMBUILD_SPEC_DIR="$RPMBUILD_DIR/SPECS" -( +{ + dnf install -y $INPUT_BUILD_REQUIRES + dnf install -y $INPUT_REQUIRES readonly WORKDIR="/tmp/work" mkdir "$WORKDIR" cp /template.spec "$WORKDIR" @@ -41,7 +43,7 @@ readonly RPMBUILD_SPEC_DIR="$RPMBUILD_DIR/SPECS" cp -p template.spec "$RPMBUILD_SPEC_DIR" cat template.spec rpmbuild -bb "$RPMBUILD_SPEC_DIR/template.spec" -) +} cp -p "$RPMBUILD_DIR/RPMS/$(uname -m)"/*.rpm .