Search code examples
dockercentos7rhel

Docker installation through kick-start


How to add full docker packages into Kick-start file with all the dependencies?

I am adding docker repository:

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

Solution

  • add a post at the end of a kickstart file like this

    %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