4

Is there a way to create a Centos system inside a chroot using something similar to debootstrap for Debian/Ubuntu? I’d need it for a container project where Docker is NOT a solution(I’d use systemd containers). Unfortunately, I’m unable to find anything relevant on the web.

Thanks for your help.

icebit
  • 205
  • 2
  • 8
  • Using yum, the bottom of the nspawn man page has examples – llua Dec 02 '20 at 19:40
  • Same as here, but use CentOS (or Rocky or whatever) repos: https://superuser.com/questions/1677683/how-do-you-create-a-chroot-environment-for-opensuse-leap – KJ7LNW Jul 21 '22 at 22:43

2 Answers2

1

Ok, according to systemd-nspawn's manual there is an alternative to manually installing using debootstrap or similar:

 Example 1. Download a Fedora image and start a shell in it

           # machinectl pull-raw --verify=no \
                 https://download.fedoraproject.org/pub/fedora/linux/releases/32/Cloud/x86_64/images/Fedora-Cloud-Base-32-1.6.x86_64.raw.xz \
                 Fedora-Cloud-Base-32-1.6.x86-64
           # systemd-nspawn -M Fedora-Cloud-Base-32-1.6.x86-64

This example can easily adapted for Centos. In fact they provide download support for raw images at the following link: https://cloud.centos.org/centos/8/x86_64/images/.
I hope this will help.

icebit
  • 205
  • 2
  • 8
0

There is an alternative too to debootstrap for Fedora called supermin (formerly called febootstrap).

jsbillings
  • 24,006
  • 6
  • 56
  • 58