2024-04-06 12:41:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
readonly CMD=$(basename "${0}")
|
|
|
|
|
|
|
|
function usage() {
|
|
|
|
echo
|
2024-10-27 14:13:54 +00:00
|
|
|
echo "usage: ${CMD} [fedora|debian|rust]"
|
2024-04-06 12:41:38 +00:00
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
usage
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "${1}" in
|
|
|
|
fedora)
|
2024-09-21 13:30:06 +00:00
|
|
|
NAME="f41"
|
|
|
|
IMAGE="fedora-thrrgilag:41"
|
2024-04-06 12:41:38 +00:00
|
|
|
BUILDFILE="Containerfile.fedora-distrobox";;
|
|
|
|
debian)
|
|
|
|
NAME="debian-bookworm"
|
|
|
|
IMAGE="debian-thrrgilag:bookworm"
|
|
|
|
BUILDFILE="Containerfile.debian-distrobox";;
|
2024-10-27 14:13:54 +00:00
|
|
|
rust)
|
|
|
|
NAME="rusty"
|
|
|
|
IMAGE="rusty-fedora:41"
|
|
|
|
BUILDFILE="Containerfile.rust-distrobox";;
|
2024-04-06 12:41:38 +00:00
|
|
|
*)
|
|
|
|
usage
|
|
|
|
exit 0;;
|
|
|
|
esac
|
|
|
|
|
2024-08-17 00:44:58 +00:00
|
|
|
TOOLBOX_DIR_FIX="${HOME}/.local/share/containers/storage/volumes/"
|
|
|
|
if [ ! -d "${TOOLBOX_DIR_FIX}" ]; then
|
|
|
|
mkdir -p "${TOOLBOX_DIR_FIX}"
|
|
|
|
fi
|
|
|
|
|
2024-04-06 12:41:38 +00:00
|
|
|
podman build -t "${IMAGE}" -f "${BUILDFILE}"
|
2024-04-06 13:45:54 +00:00
|
|
|
distrobox create --name "${NAME}" --home "${HOME}/h/${NAME}" -i "localhost/${IMAGE}"
|