BootStrap: yum
OSVersion: 8
MirrorURL: https://dl.rockylinux.org/pub/rocky/%{OSVERSION}/BaseOS/x86_64/os/
# https://dl.rockylinux.org/pub/rocky/8/BaseOS/x86_64/os/repodata/
Include: dnf

# If you want the latest updates to be installed inside the container 
# during the bootstrapping process then uncomment the following line:
# OLD UpdateURL: http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/updates/$basearch/
# UpdateURL: http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/

%labels
    Maintainer Mike Lake
    Version 1.0

%help
    This is a Rocky Linux 8 container for running fortune and cowsay.

%runscript
    echo "This is what happens when you run the container..."
    fortune | cowsay

%setup
    # These are only required if running on the HPC.
    mkdir -p ${APPTAINER_ROOTFS}/opt
    mkdir -p ${APPTAINER_ROOTFS}/scratch
    mkdir -p ${APPTAINER_ROOTFS}/shared

%post
    echo "Hello from inside the container"
    dnf -y install epel-release
    dnf -y install cowsay fortune-mod

