41 lines
797 B
Bash
Executable file
41 lines
797 B
Bash
Executable file
#!/bin/bash
|
|
|
|
readonly CMD=$(basename "${0}")
|
|
|
|
function usage() {
|
|
echo
|
|
echo "usage: ${CMD} [fedora|debian|rust]"
|
|
echo
|
|
exit 1
|
|
}
|
|
|
|
if [ $# -lt 1 ]; then
|
|
usage
|
|
exit 0;
|
|
fi
|
|
|
|
case "${1}" in
|
|
fedora)
|
|
NAME="f41"
|
|
IMAGE="fedora-thrrgilag:41"
|
|
BUILDFILE="Containerfile.fedora-distrobox";;
|
|
debian)
|
|
NAME="debian-bookworm"
|
|
IMAGE="debian-thrrgilag:bookworm"
|
|
BUILDFILE="Containerfile.debian-distrobox";;
|
|
rust)
|
|
NAME="rusty"
|
|
IMAGE="rusty-fedora:41"
|
|
BUILDFILE="Containerfile.rust-distrobox";;
|
|
*)
|
|
usage
|
|
exit 0;;
|
|
esac
|
|
|
|
TOOLBOX_DIR_FIX="${HOME}/.local/share/containers/storage/volumes/"
|
|
if [ ! -d "${TOOLBOX_DIR_FIX}" ]; then
|
|
mkdir -p "${TOOLBOX_DIR_FIX}"
|
|
fi
|
|
|
|
podman build -t "${IMAGE}" -f "${BUILDFILE}"
|
|
distrobox create --name "${NAME}" --home "${HOME}/h/${NAME}" -i "localhost/${IMAGE}"
|