Docker Community Forums

Share and learn in the Docker community.

Linux Kickstart to Docker

I have a Linux Kickstart file and i am using this file for automation of the OS installation. Now i want to migrate my project to Docker container, but i didn’t understand somethings. I want to explain my situation:

For example, i am using the following lvm configuration in my kickstart file:

part pv.00 --size=1 --grow --ondisk=sda

volgroup vg00 pv.00

logvol / --vgname=vg00 --size=4096 --fstype=ext4 --name=root
logvol /var --vgname=vg00 --size=2048 --fstype=ext4 --name=var
logvol /var/log --vgname=vg00 --size=3072 --fstype=ext4 --name=var_log
logvol /home --vgname=vg00 --size=500 --fstype=ext4 --name=home
logvol /tmp --vgname=vg00 --size=2048 --fstype=ext4 --name=tmp

I think on the container side, these operations are not using. Some say you can use devicemapper or you can use volumes.
What is the correct procedure for these operations to the Docker side? How should I go about it? My application is needed these disk partitions.

Also, i have another question.
Can i follow the following procedures:

   - Create an OS image using livemedia-creator with my Kickstart file. Therefore i can complete the OS operations.
   - Import that OS to the Docker
   - Use that OS as a base image for my Dockerfile

I can see two options:
– handle your disk partioning stuff on the os level and bind those folders into your container.
– don’t use docker. Your requirement are better suited for classic vm’s.

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