more convenient build scripts for debian

This commit is contained in:
Mario Voigt 2025-03-15 14:53:11 +01:00
parent d1681ffecb
commit db8ea819cb
2 changed files with 24 additions and 14 deletions

View File

@ -108,6 +108,14 @@ for ARCH_L in "${!ARCHES_LR[@]}"; do
# - some environment vars (ARCH_LINUX, ARCH_RUST, required by the debian packager) # - some environment vars (ARCH_LINUX, ARCH_RUST, required by the debian packager)
sudo podman run --replace -d --tty --interactive -v ${SRCDIR}:/srcdir -v ${DOWNLOAD}:/download -e ARCH_LINUX=${ARCH_L} -e ARCH_RUST=${ARCH_R} --name fabinfra_deb_${ARCH_L} --platform linux/${ARCH_D} localhost/fabinfra/debianpackage_${ARCH_D} sudo podman run --replace -d --tty --interactive -v ${SRCDIR}:/srcdir -v ${DOWNLOAD}:/download -e ARCH_LINUX=${ARCH_L} -e ARCH_RUST=${ARCH_R} --name fabinfra_deb_${ARCH_L} --platform linux/${ARCH_D} localhost/fabinfra/debianpackage_${ARCH_D}
#test the container
sudo podman exec -u 0 --tty --interactive fabinfra_deb_${ARCH_L} bash -c "echo"
if [ $? -ne 0 ]; then
echo -e "Error creating or attaching to container 'fabinfra_deb_"${ARCH_L}"'. You might need to re-run 'install-requirements.sh'."
sudo podman logs fabinfra_deb_${ARCH_L}
exit 1
fi
# now attach to that container and start building the packages # now attach to that container and start building the packages
#sudo podman exec -u 0 --tty --interactive fabinfra_deb_${ARCH_L} bash #sudo podman exec -u 0 --tty --interactive fabinfra_deb_${ARCH_L} bash
sudo podman exec -u 0 --tty --interactive fabinfra_deb_${ARCH_L} bash -c " sudo podman exec -u 0 --tty --interactive fabinfra_deb_${ARCH_L} bash -c "

View File

@ -12,22 +12,24 @@ sudo systemctl daemon-reload
# Please note: we need to install these images as root user! # Please note: we need to install these images as root user!
pack="fabinfra/debianpackage" pack="fabinfra/debianpackage"
arch="arm64/v8" echo -e "\n\nThis script will (re)-create podman images for bffh builds. This may take a lot of time.\n\n"
echo -e "\n+++++++++++++++++++++++++++++++++++++++++++" read -p "Do you really want to continue? y/n?" -n 1 -r
echo -e "creating local podman container registry $pack. This may take a while ..." echo
echo -e "+++++++++++++++++++++++++++++++++++++++++++\n" if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo time podman build --platform=linux/${arch} -f Dockerfile -t ${pack}_${arch} #this should get ubuntu:noble for arch in arm64/v8 arm/v7; do
sudo podman image rm localhost/${pack}_${arch} --force
arch="arm/v7" echo -e "\n+++++++++++++++++++++++++++++++++++++++++++"
echo -e "\n+++++++++++++++++++++++++++++++++++++++++++" echo -e "creating local podman container registry for ${pack}_${arch}. This may take a while ..."
echo -e "creating local podman container registry $pack. This may take a while ..." echo -e "++++++++++++++++++++++++++++++++++++++++++\n"
echo -e "+++++++++++++++++++++++++++++++++++++++++++\n" sudo time podman build --platform=linux/${arch} -f Dockerfile -t ${pack}_${arch} #this should get ubuntu:noble
sudo time podman build --platform=linux/${arch} -f Dockerfile -t ${pack}_${arch} #this should get alpine:latest if [ $? != 0 ]; then
echo -e "\nBuild did no finish. Probably you got an error like 'container process (missing dynamic library?)'. In this case a system restart should fix!"
fi
done
echo -e "\n+++++++++++++++++++++++++++++++++++++++++++" echo -e "\n+++++++++++++++++++++++++++++++++++++++++++"
echo "listing installed images ..." echo "listing installed images ..."
echo -e "+++++++++++++++++++++++++++++++++++++++++++\n" echo -e "+++++++++++++++++++++++++++++++++++++++++++\n"
sudo podman images | grep localhost/fabinfra/
# note: unrequired images can be removed again by: PACK=${pack} sudo podman images | grep localhost/$PACK
# sudo su && podman image rm localhost/fabinfra/<name> fi