Docker/LXD container images

I’ve managed to create LXC container from the CentOS 8 one, and I use its snapshot to create more LXC RockyLinux containers. I use Fedora 33 with the ganto/lxc4 Copr copr. The process should be the same on every distro which has LXC/LXD. Here is the step-by-step guide:

  1. Create the container:
    lxc launch images:centos/8 rocky_linux

  2. Go into the container
    lxc exec rocky_linux /bin/bash

  3. Execute the following:

rpm -e --nodeps centos-gpg-keys centos-linux-release centos-linux-repos

rpm -ivh https://download.rockylinux.org/pub/rocky/8.3/BaseOS/x86_64/os/Packages/rocky-release-8.3-13.el8.noarch.rpm \
https://download.rockylinux.org/pub/rocky/8.3/BaseOS/x86_64/os/Packages/rocky-repos-8.3-13.el8.noarch.rpm \
https://download.rockylinux.org/pub/rocky/8.3/BaseOS/x86_64/os/Packages/rocky-gpg-keys-8.3-13.el8.noarch.rpm

dnf distro-sync
  1. Reboot the container.
    sbin reboot -n

Congrats, you have a RockyLinux 8.3 container now! You can make a snapshot of it, and use it to create more containers of that type.

PS. it may be that the upstread has newer rocky-release, rocky-repos and rocky-gpg-keys packages on their file server. If the rpm command fails, check the file server for new file names, and run it again.

mrak$ lxc exec rocky_linux /bin/bash

[root@rocky_linux ~]# cat /etc/rocky-release
Rocky Linux release 8.3

[root@rocky_linux ~]# dnf repolist
repo id                                          repo name
appstream                                        Rocky Linux 8 - AppStream
baseos                                           Rocky Linux 8 - BaseOS
extras                                           Rocky Linux 8 - Extras
3 Likes