Add base image script

This commit is contained in:
Iván Chavero 2022-10-14 10:40:52 -06:00 committed by Renich Bon Ćirić
parent 4635be11a2
commit 5034999449

View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -o errexit
source ../create_images.shlib
if [[ -z $1 ]] || [[ -z $2 ]]; then
echo "Usage: $0 <image_name> <release_version>"
exit
fi
## Build micro image
bootstrap_env "scratch"
# Install a basic filesystem and minimal set of packages, and microdnf
dnf install -y --disablerepo=* --installroot $MOUNTPOINT --releasever $RELEASEVER \
$CENTOS_RELEASE_REPOS $CENTOS_RELEASE $CENTOS_GPG
dnf install -y --installroot $MOUNTPOINT \
--releasever $RELEASEVER glibc-minimal-langpack --nodocs \
--setopt install_weak_deps=False
# Cleanup
clean
buildah unmount $CONTAINER
# Save the container to an image
buildah commit --squash $CONTAINER "localhost/${IMAGE_NAME}:stream${RELEASEVER}"