Switch between docker/podman commands automatically

This commit is contained in:
Peter Cai 2024-02-15 14:08:28 -05:00
parent 615aee34b7
commit 2a4b6ed116

View file

@ -4,9 +4,15 @@ set -e
[ -z "$1" ] && exit 1
docker build $1 -t gitea.angry.im/petercxy/$1:latest
docker push gitea.angry.im/petercxy/$1:latest
DOCKER=docker
if ! command -v $DOCKER &> /dev/null; then
DOCKER=podman
fi
$DOCKER build $1 -t gitea.angry.im/petercxy/$1:latest
$DOCKER push gitea.angry.im/petercxy/$1:latest
while ! [ "$?" -eq 0 ]; do
docker push gitea.angry.im/petercxy/$1:latest
$DOCKER push gitea.angry.im/petercxy/$1:latest
done