Skip to content

Instantly share code, notes, and snippets.

@orodbhen
orodbhen / create_rootfs_ for_CentOS_8_0_container_image.md
Last active July 28, 2022 03:20
Create a rootfs tar archive for a CentOS 8.0 container (i.e. docker) base image

I needed a CentOS 8.0 image, and there isn't one on Dockerhub, so I had to create one myself.

The official instructions for creating CentOS container images Uses a kickstart file and a CentOS boot image with the livemedia-creator tool to generate a rootfs tar archive. This can then be passed to docker import to create the image.

However, because using the boot image requires running qemu, and I didn't have a physical Linux host, I used these alternative instructions to create the tar archive, with some modifications.

I modified the kickstart to use the 8.0 repos at http://vault.centos.org, and copied it into a VirtualBox VM, created from the 8.0 boot image. I then did the following inside the VM:

  • Disabled selinux and firewalld
  • Installed `l