Docker 通过 kick-start 安装

Docker installation through kick-start

如何将完整的 docker 包与所有依赖项一起添加到 Kick-start 文件中?

我正在添加 docker 存储库:

repo --name="docker-ce-stable" --baseurl=https://download.docker.com/linux/centos/7/$basearch/stable

像这样在 kickstart 文件末尾添加一个 post

%post --log=/var/log/post.log
exec < /dev/tty3 > /dev/tty3
chvt 3
echo "################################"
echo "# Running Post Configuration   #"
echo "################################"
echo "exclude=kernel*" >> /etc/yum.conf
# update the system
yum update -y
#Setting docker-repo
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#Installing docker
yum install -y docker-ce-18.09.2-3.el7 docker-ce-cli-18.09.2-3.el7 
containerd.io-1.2.2-3.el7
%end