ampere_research/pytorch/build.sh

16 lines
410 B
Bash
Raw Permalink Normal View History

2024-11-28 00:04:57 -05:00
#! /bin/bash
2024-12-09 10:57:15 -05:00
containerfile_name="$1"
image_name="${containerfile_name%.*}"
2024-11-28 00:04:57 -05:00
if [[ -z "$1" ]]; then
echo "Missing image name argument!"
exit 1
fi
2024-12-09 10:57:15 -05:00
podman build . -t "$image_name":latest -f "$containerfile_name" && \
2024-11-28 00:04:57 -05:00
podman save localhost/"$image_name":latest -o "$image_name".img && \
rm -fv "$image_name".sif && \
apptainer pull "$image_name".sif docker-archive:"$image_name".img
rm -v "$image_name".img