#!/usr/bin/env bash # # Create a base CentOS Docker image. # # This script is useful on systems with yum installed (e.g., building # a CentOS image on CentOS). See contrib/mkimage-rinse.sh for a way # to build CentOS images on other systems. yum_config=$1 target=$2 projectdir=$3 kernel_version="5.4.113-1.el7.elrepo.x86_64" set -ex package_to_install="@base @core @debugging @directory-client @guest-agents @hardware-monitoring @network-file-system-client @performance @remote-system-management grub2 epel-release efibootmgr ansible yum-utils ipmitool docker-ce docker-ce-cli containerd.io lrzsz python3 vconfig watchdog pcm" locak_package_to_install="$projectdir/package/kernel-lt-$kernel_version.rpm $projectdir/package/kernel-lt-devel-$kernel_version.rpm" setopt="group_package_types=mandatory,default,optional" yum -c "$yum_config" --installroot="$target" -y makecache yum -c "$yum_config" --installroot="$target" -y --setopt=$setopt install $package_to_install yum -c "$yum_config" --installroot="$target" -y --setopt=$setopt localinstall $locak_package_to_install cat > "$target"/etc/sysconfig/network < input/centos-7-chroot.tar.bz2 #rm -rf "$target"